Commit Graph

23 Commits

Author SHA1 Message Date
ian%hixie.ch
6fded81564 Don't try to load the Exporter module. Don't try to load modules without a __DATA__ section. Don't try to evaluate the block if trying to read it failed. 2004-02-25 17:41:30 +00:00
ian%hixie.ch
070ffc9042 More bullet proofing for the module loading; Better handling of inherited AUTOLOADs; minor fixups. 2003-03-27 19:59:32 +00:00
ian%hixie.ch
56529c19a2 remove DESTROY code, rework the output system to use a single hash instead of passing arguments around, delay the loading of certain modules, fix some bugs with the removal of the built in property system, make the TemplateToolkit module only have one template object, and cache the precompiled documents, remove the HTTP output module, and other optimisations. 2003-03-15 14:14:21 +00:00
ian%hixie.ch
ceef63652c Improve the Exception class so it can work out what 'eval' numbers map to; remove the 'properties' stuff since it was taking a good 4% of the overall time of PLIF applications. THIS WILL CAUSE HUGE PROBLEMS WITH PLIF CONSUMERS. I REPEAT, THIS **WILL** BREAK YOUR CODE. DO NOT UPDATE TO THIS CODE IF YOU DON'T WANT TO SPEND A LOT OF TIME UPDATING YOUR CODE\!\!\! 2003-03-14 13:08:43 +00:00
ian%hixie.ch
61ccca3ec8 Stop perl parsing source files that aren't used. (Lazy loading using __DATA__ blocks) 2003-03-14 07:50:18 +00:00
ian%hixie.ch
536b1383f8 Make methodMissing use syntaxError instead of error(). Remove all the user level, error reporting and fatal handlers nonsense. Remove the debug() method. Update error() and assert() to be simply quick shortcuts to raising exceptions, using deep magic to make the stacktraces look good. 2003-01-02 20:39:49 +00:00
ian%hixie.ch
a614ace041 Replace Carp.pm with Exception.pm so that we have a consistent interface to exceptions and errors. Also add a syntaxError check in AUTOLOAD to make sure we don't call it when we shouldn't. 2002-12-30 08:04:29 +00:00
ian%hixie.ch
08576caa95 Minor comment fixup 2002-12-25 14:14:11 +00:00
ian%hixie.ch
574e9443e3 Adding more debug code to make my life easier. 2002-11-02 17:56:51 +00:00
ian%hixie.ch
cae1696299 More debugging information at high verbosity settings. 2002-09-09 19:22:10 +00:00
ian%hixie.ch
dc80936c17 Made debug() be level 6 instead of level 7. Added various comments. 2001-12-26 19:12:57 +00:00
ian%hixie.ch
988853e179 Removing a bunch of dump(10, ...) calls. It turns out that dump() is actually quite expensive, and calling it 1000+ times just to do nothing isn't that useful. In addition, most of these dump()s were used to debug the core PLIF code which now works pretty well, so they aren't that useful any more. 2001-12-04 18:06:06 +00:00
ian%hixie.ch
ee423a9430 * Created service- and serviceInstance- specific constructors so that a single module can have distinct constructors depending on how it is invoked. These constructors are called serviceInit() and serviceInstanceInit(), and both chain to the existing init() constructor (so no change are required by this).
* Changed FileStrings so that it doesn't have to be updated every time the file string format changes. The format is now one line per piece of metadata, then a blank line, then the string data. If additional metadata is added later then this will automatically support it.
* Renamed the dataSource.strings service to dataSource.strings.customised, and renamed its get() method to getCustomisedString().
* Changed the semantics of dataSource.strings.customised so that it no longer looks for a default string if it can't find a customised one (and thus removed getDefaultString).
* Abstracted the Generic output module even more. It now consists of output.generic (a service instance with its own constructor) and dataSource.strings (a pure service), the latter of which is a wrapper around dataSource.strings.customised and dataSource.strings.defaults.
* Updated Coses to work with the new dataSource.strings insterface.
* Removed the test app DataSource::ConsoleStrings and DataSource::HTTPStrings files, since they were redundant with the default output files.
* Removed all the default strings in the CosesEditor and Login components since they are pretty pointless.
* Factored out the call to dump() in the GenericOutputs module.
* Changed setString in the MySQL string data source so that it will now add a blank string (it used to delete the string if it was blank, but that meant that it was not possible to customise strings away).
* Added a piece of metadata to strings: their version number.
* Updated the customised string data source stubs to mention the version data now stored with all strings
* Added a getAllStringVersions method to the customised strings data source which returns all the string names and their version numbers.
* Made the customised strings data source check the version number of every string in its database during setupInstall to make sure that they are all up to date, version-wise. If any are out of date, the user is notified.
* Added support for the new version column to the MySQL version of the customised string data source.
* Updated the increasingly misnamed CosesEditor to support the versioned strings stuff.
* Factored out some code in the CosesEditor.
* Added version information to all default strings. All default strings are now at version 1.
* Fixed a typo in a FileStrings dump statement.
* Fixed the calls to setProgress in the MySQL user and strings data sources and in the user field factory to use the correct syntax (a parsable dotted string instead of unlocalisable plain English).
* Updated the Generic output module's documentation to match what now happens.
2001-11-22 15:46:42 +00:00
ian%hixie.ch
3ae1b10178 Adding a comment on the use of assert() 2001-11-09 20:09:22 +00:00
ian%hixie.ch
fd84ee0b49 Change default DEBUG level from 9 to 4, which is what it should be in production releases. Added comments explaining debug levels 6 (reserved for personal use) and 8. Added level 10 debug info to the DESTROY method (makes it easier to track down bugs during shutdown). 2001-11-09 16:50:47 +00:00
ian%hixie.ch
a6fc410cbf Adding comments to clearly indicate that no dump()s, warn()s or error()s should have a level lower than 5 unless they are not expected to occur during normal operation. Also changing the default level at which the user is notified of problems from 3 to 1. 2001-11-08 16:47:25 +00:00
ian%hixie.ch
f21e5053e8 Corrected an oversight in the service instance creation code: if a service acts as both a service instance and a normal service, it needs a special constructor to force the creation of the instance, otherwise if the service is created first it will be used again for the instances. 2001-09-19 17:56:15 +00:00
ian%hixie.ch
6ba9034d6e Added the message level number to the debug output to help gauge what level is useful. 2001-09-09 17:55:21 +00:00
ian%hixie.ch
86e3bcd2ae * Improved the helpfulness of the extremely verbose debugging information of PLIF.pm by quoting embedded variables
* Implemented MagicCollectingArray, which acts like MagicPipingArray except that the result is collected into one big array instead of multiple arrayrefs
* Added the relevant getCollecting*List methods to the Controller class
* Added DESTROY methods to the magic array to prevent DESTROY method calls from being propagated
* Made the debug.dumpVars string more robust when the data hash includes one of the three magic characters '(', '.' or ')'
* Implemented sanitation in COSES so that any keys in the data hash containing one of the three magic characters '(', '.' or ')' will have them transliterated to '[', ':' and ']' respectively (sanitation is optional and can be bypassed)
* Changed the API of the generic output module's 'output' method to take the optional $session argument last, thus simplifying the call sites a lot
* Implemented the 'dispatcher.output' service in several classes to return strings that must be support in variants (required for a good UI in the COSES editor)
* Renamed the Login module's strings so that they use the dot-notation separating significant parts
2001-06-04 06:13:22 +00:00
ian%hixie.ch
a47f424255 Added a bit more support for objects (as opposed to services): added a new objectCreate() constructor and an objectInit() method.
Added an optimisation to Controller.pm so that service names will be hashed once accessed. This should make multiple accesses of the same service a lot quicker. To go with this I added some diagnostics code (on exit) and moved the code around a little bit.
Fixed a minor transgression of the coding style guidelines in Magic*Array.pm. :-)
Neatened up the code in Output.pm.
Made it so Session objects assume they have an 'app' property, and so don't need to be passed $app all the time. (Sessions are objects now.)
Added an unimplemented getAddress() method to the Session class.
2001-05-13 18:04:52 +00:00
ian%hixie.ch
b8a735d31d * fixed the methodMissing() method so that it actually is possible to use it to do method dispatching;
* factored out some of the method dispatching code by adding a dispatchMethod() method to the controller;
* turned the Dispatcher class into simply a function on the base Service class and removed Dispatcher.pm;
* made it possible for services to be both services and objects and provide different services depending on which context they were called in (and used this to make the AdminCommands module actually do what it was intended to in the first place, namely, only work for CommandLine access);
* fixed it so if a service is first created by getServiceList the constructed version will actually be cached;
* made output more generic by allowing services to implement arbitrary parts of the output API, used that to make AdminCommands usable without requiring additional code to support it;
* added some documentation;
* added some dump(10) statements to help debugging;
* fixed the string datasource SQL;
* fixed the DBI database so it can handle errors;
* added tableExists API to the DBI database helper.
Thanks to myk, justdave and zach for some ideas.
2001-05-06 06:26:24 +00:00
ian%hixie.ch
1dc1d947ea Implementing (and documenting!) PLIF::debug() as suggested by zach. a=hixie 2001-05-05 18:28:08 +00:00
ian%hixie.ch
0baba2d269 work in progress 2001-05-05 07:12:56 +00:00