Re: [Coding Standards] Loading all files at once
| From: | Alexey Borzov | Date: | Tue, 10 Jul 2007 13:39:09 +0000 |
| Subject: | Re: [Coding Standards] Loading all files at once | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47390@lists.php.net to get a copy of this message | ||
Hi,
Paul M Jones wrote:
Zend and Solar both use a static method for class-loading; I think PEAR2 might benefit from using something like that too. (It's not a base class, just a class with some static methods.) Alexey's inclusion of a loadPackage() method is particularly interesting.While Zend does have a Zend_Loader class, they also use require_once throughout the code and rely on include_path setting. Which leads us to the question whether the problems with those are greatly exaggerated: folks at Zend probably do have a clue.
However, there is a chicken-and-egg problem here: you have to include the PEAR2_Loader class to begin with. Dunno if that's a deal-breaker or not.I don't see "chicken-and-egg" problem, since we'll need just to include one file here that'll not have any dependencies (only maybe on PEAR2_Exception, but we can put Loader and Exception into one file).