Re: Rethink CS for require_once?
| From: | Greg Beaver | Date: | Wed, 01 Dec 2004 23:55:37 +0000 |
| Subject: | Re: Rethink CS for require_once? | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34715@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
however the actual implementation of the autoload method should be left to the user. we can just provide the necessary pieces. so if we define a common PEAR::loadClass() method we can check if an __autoload() function exists or not. If it exists then we can delegate the job of loading the code to the __autoload() function.Not a bad idea, except this puts even more code into the PEAR.php file, which I don't think is a practical idea. We should be moving away from using generic base classes, that was the biggest mistake of PEAR's initial design, imo. However, recommending this code be a common API is good, so that DB::loadClass() may work differently from LiveUser::loadClass(), but the API signature is the same. If we instead require that the method exist, then users can count on it, especially since it's likely to be a 2-5 liner. Greg