Re: Rethink CS for require_once?
| From: | Lukas Smith | Date: | Wed, 01 Dec 2004 08:25:15 +0000 |
| Subject: | Re: Rethink CS for require_once? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34684@lists.php.net to get a copy of this message | ||
Greg Beaver wrote:
So, the new standard would be: for (1) use dirname(__FILE__) for absolute inclusion require_once dirname(__FILE__) . '/Foo/Driver.php';well I remember about 2 years ago several people discussed this topic. I remember that Stig shot the idea down in favor of the include path. Right around that time he added set_include_path() to have a chance for users to set the include path on shared hosts where ini_set() is disabled. However nobody remembers these reasons that Stig brought up, including Stig. I remember something about dirname(__FILE__) also not being very high performance. However the overhead is contant whereas a growing include path will eat more and more performance. I also remember that back then I decided to add loadFile methods etc to MDB2 and factories to LiveUser to make sure that people only include the base file and that all other files are loaded by the class itself. To conclude I also remember that I was heavily on the dirname(__FILE__) side. So maybe someone can search the archives from around the time before set_include_path() was added to see what turned my opinion around :-) regards, Lukas