Re: [Coding Standards] Loading all files at once
| From: | Matthew Weier O'Phinney | Date: | Tue, 10 Jul 2007 12:59:33 +0000 |
| Subject: | Re: [Coding Standards] Loading all files at once | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47379@lists.php.net to get a copy of this message | ||
On 7/9/07, Joshua Eichorn <josh@bluga.net> wrote:
Matthew Weier O'Phinney wrote: I'm clueless as to what you're referring to here. I use PEAR, Solar, and Zend Framework regularly, and typically have them installed to a common directory, leaving me with a simple include_path of: .:/path/to/pear and never have a problem, even when using __autoload() (check out Zend_Loader::registerAutoload() for a PEAR-friendly spl_autoload implementation, btw). Could you please elaborate on the "include_path mess" that you're trying to solve with this? Trying making this work without setting your include path.Honestly, if a developer can't set the include_path, s/he probably needs to read the PHP manual a bit more. However, even this can be relatively easily overcome with something like a PEAR2_Loader class; if we create methods to manipulate the include_path, it could be something like this: require_once '/path/to/PEAR2/Loader.php'; PEAR2_Loader::initIncludePath(); // Sets the include_path to
// include PEAR2 based on the
// location of the PEAR2_Loader
// class file.
PEAR2_Loader::registerAutoload(); // Register autoload callback
// with spl_autoload.
Also note that you have a mix of autoload and normal includes, which may or may not give you the minimum # of required files.It'll almost certainly give you fewer than those loaded via allfiles.php. -- Matthew Weier O'Phinney mweierophinney@gmail.com http://weierophinney.net/matthew/