Re: autoload, include_once naming conventions
| From: | Lukas Smith | Date: | Thu, 17 Mar 2005 21:47:43 +0000 |
| Subject: | Re: autoload, include_once naming conventions | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36728@lists.php.net to get a copy of this message | ||
Paul M Jones wrote:
Lukas Smith wrote:I wouldnt want this static method to return an instance of an object. it should only be concerned with ensuring that the requested class is defined or delegate the task to __autoload() if defined. regards, Lukaswhile 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 "/".This sounds very much like what I'm doing with the Solar project (http://solarphp.com). You make the call like this: // will look for Some/Class/Name.php $obj = Solar::object('Some_Class_Name');