Re: [Coding Standards] Loading all files at once
| From: | Paul M Jones | Date: | Mon, 09 Jul 2007 22:18:33 +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-47323@lists.php.net to get a copy of this message | ||
On Jul 9, 2007, at 5:10 PM, Joshua Eichorn wrote:
Paul M Jones wrote:OK, I can get on board with that. However, that still doesn't sound like an argument for "allfiles" -- it sounds more like an argument for the following:On Jul 9, 2007, at 4:44 PM, Joshua Eichorn wrote:It seems a lot more important when you want to bundle a portion of PEAR inside you wordpress plugin to make your graphs just work. There are lots of other cases including environments where you don't have permission to set the include_path.Philippe Jausions wrote:There are lots of common complaints about PEAR ;-) some of them warranted and some of them not. I think this falls in the "not warranted" category, myself.I also find include_path quite useful. How to address lazy-loaded user self-patched PEAR packages, if not with include_path? (note the dirname(__FILE__)) Also, how would package inter-dependency be handled with allfiles.php file(s)? -PhilippeI find include_path useful too, but having to set is also a very common complaint about pear.
That is, require/include should always be prefixed with PEAR2_PATH, so that users of third-party apps (which have their own include systems) can set the PEAR2_PATH value instead of working via set_include_path(). Looks ugly, I'll grant you, but I think it meets the flexibility requirement you mention. -- Paul M. Jones <http://paul-m-jones.com> Solar: Simple Object Library and Application Repository for PHP5. <http://solarphp.com> Join the Solar community wiki! <http://solarphp.org> Savant: The simple, elegant, and powerful solution for templates in PHP. <http://phpsavant.com>Anyhow if you use constants as part of the allfiles.php you can create a setup where you can still use include paths as needed. Something like: |if (!defined('PEAR2_PATH')) { define('PEAR2_PATH', dirname(__FILE__).'/'); } require PEAR2_PATH . 'HTTP/Request.php'; Then if you want to use include path you just set PEAR2_PATH to an empty string.This might be the seed of a useful compromise; instead of requiring allfiles, we might state that require/include use the PEAR2_PATH prefix in all cases.