Re: autoload, include_once naming conventions
| From: | Stephan Schmidt | Date: | Thu, 17 Mar 2005 21:52:38 +0000 |
| Subject: | Re: autoload, include_once naming conventions | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36729@lists.php.net to get a copy of this message | ||
Hi,
Lukas Smith schrieb:
could you provide your implementation ... its always better to have someting that has been in use. all it needs is an additional check to not do anything if an __autoload() function has been registered. Sorry, I do not have any code that could be used, as it'sa) only for PHP5 b) very specific to the problems in my project.
Appearently Marcus has added some __autoload() related goodies to spl in PHP HEAD that we should probably also take a look at. Yes, his additions look nice, but I guess the feature should be working in PHP4 as well. Users could register PEAR::loadClass() as __autoload() function if they like. But I can't imagine how we should leverage his changes.And today Timm (Friebe) showed my something he's using in his framework that could be added as well to the loadClass method: class Foo {
function __static()
{
// do some class level init stuff here.
}
}
PEAR::loadClass('Foo');
This would load the class and call Foo::__static() if it has been defined. I'd really like to have this in PEAR and it only requires one call to is_callable().
I could provide a patch for PEAR.php during the next week.
Stephan
--
http://www.php-tools.net
http://www.schst.net
http://pear.php.net