Re: Rethink CS for require_once?

From: Date: Wed, 01 Dec 2004 14:36:09 +0000
Subject: Re: Rethink CS for require_once?
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34694@lists.php.net to get a copy of this message
Andrew Nagy wrote:
Greg Beaver wrote:
I don't know if this has been discussed before, but what about using just require for internal packages and require_once for external? Rasmus Lerdorf mentioned at a PHP conference that require_once is really slow and should be avoided at all costs. Considering the app programmer most likely will not be including files buried deep with in a pear package, this may be more beneficial? Has this been discussed?
well its not going to work except if we start putting if (class_exists()) all over the place before an include. The future looks bright though with php5's autoload. Maybe we can think of a forward compatible way of handling autoload via a PEAR::loadClass() method. This method would essentially either load the class from a given name by replacing "_" with "/" and calling require_once() for PHP4 and do nothing for PHP5 relying on autoload to work (and our common autoload method would do essentially what the PHP4 version of the loadClass would do). regards, Lukas

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