autoload, include_once naming conventions
| From: | Lukas Smith | Date: | Wed, 16 Mar 2005 17:16:27 +0000 |
| Subject: | autoload, include_once naming conventions | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-36704@lists.php.net to get a copy of this message | ||
Hi,
while talking with Derick about what we dont like about PHP5 in Budapest I got an idea ...
Basically what if we would replace all (require|include)_once calls with a static PEAR method. This method would get a class name passed and would simply do an class_exists() call and if the class do include the code by replacing "_" to "/". The class_exists() call is going to be a much cheaper way in most cases than having to call include_once only to find out the code has already been included even if this adds a function call to said static method. That static method could even skip the class_exists() call if on systems that are running PHP5.
This would enable PHP5 users to rely on __autoload() which would for example enable them to not even use the include_path directive if they want to increase performance.
regards,
Lukas