pear2 allfiles
| From: | Evert | Rooftop | Date: | Fri, 10 Aug 2007 03:49:33 +0000 |
| Subject: | pear2 allfiles | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-47768@lists.php.net to get a copy of this message | ||
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