On Sat, 2004-09-11 at 00:49, Greg Beaver wrote:
> Hi,
>
> In my continuing battle to take channels out of my head and turn them
> into PHP code, I've run up against a particular problem many times.
> Currently, PEAR_Registry and PEAR_Config are completely separate,
> meaning that if you get a PEAR_Config object, you have to manually set
> up a PEAR_Registry object that is designed to work with that config object.
>
> Currently, PEAR_Registry does a whole bunch of disk access in its
> constructor, setting up the filemap, renaming older registry files, and
> so on.
>
> I would like to move all of that disk writing stuff into a separate
> method that is ONLY called if one of the data access methods that either
> write or read from the registry is called. This would result in 1 extra
> line of code for every method, and also in 1 extra check to see whether
> initialization has happened, but also would allow creating a
> PEAR_Registry without any directory/file creation.
>
> What this change would allow, however, is hiding a registry object
> inside of PEAR_Config such that php_dir always has a PEAR_Registry
> object associated with it, allowing code like
>
> $config = PEAR_Config::singleton();
> $reg = &$config->getRegistry('user'); // user registry for php_dir
> $reg = &$config->getRegistry('system'); // system registry for php_dir
> $config->set('php_dir', 'user', '/blah');
> $newreg = &$config->getRegistry('user'); // user registry for new
> php_dir $blah
>
> This, in turn would make it a lot easier to handle channels, as all
> channel information is stored in the registry, and in order to do
> channel-specific validation, I need to grab the channel info rather
> circuitously through grabbing a config, getting the php_dir for the pear
> channel, creating a registry, and then grabbing the registry's channel
> information. All this still would need to happen, it would just be
> cleaner and easier to debug.
>
> Any objections, or other ideas?
I don't get this. What would a "user registry for php_dir" be? Has the
world flipped sideways while I was not paying attention? :)
- Stig
--
PEAR Core List Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|