Re: pear2 allfiles

From: Date: Fri, 10 Aug 2007 03:55:45 +0000
Subject: Re: pear2 allfiles
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47769@lists.php.net to get a copy of this message
Url : http://wiki.pear.php.net/index.php/PEAR2_Standards#Loading_all_files_at_once Evert|Rooftop wrote:
I noticed the following in the wiki: <?php // note the lack of dependency on include_path - essential for beginners if (!class_exists(PEAR2_Exception)) {
     class PEAR2_Exception extends Exception {}
} require dirname(__FILE__) . '/Base.php'; require dirname(__FILE__) . '/Exception.php'; require dirname(__FILE__) . '/Drivers/Common.php'; require dirname(__FILE__) . '/Drivers/Simple.php'; require dirname(__FILE__) . '/Drivers/Fancy.php'; ?> The main reason you would want allfiles.php it allows the opcode cache to be kicked in, in the PHP parsing phase. Making use of dirname(__FILE__) makes this a conditional include (just like autoload), which this won't be evaluated during the parsing phase. I'd suggest to remove the part that says "opcode caches friendliness". I didn't want to change this myself without prior consent. Evert


« previous php.pear.dev (#47769) next »