Re: dirname(__FILE__)

From: Date: Thu, 17 Oct 2002 09:59:18 +0000
Subject: Re: dirname(__FILE__)
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10098@lists.php.net to get a copy of this message
On Wed, 16 Oct 2002, Wolfram Kriesing wrote: > Lukas Smith wrote: > > Hi, > > > > I want to once more start a little discussion about how to include files > > in pear packages. > > > > I for one intent to distribute all PEAR packages that I use as part of > > my application because I don’t want my system to break when an admin > > updates a pear package to a version that breaks BC etc. > > > > Therefore I would really welcome if people would use dirname(__FILE__) > > in their includes in order that packages don’t have to be in the include > > path. > > i think dirname(__FILE__) is a good solution. the only reason why i > for example avoided it until now was that i dont know which effect it > has on performance. may be some expert step forward and tells us :-) > i also got a lot of mails from people who have problems with the > includes inside the files, dirname(__FILE__) would solve it all! > so what do the pear-developer say about it? dirname(__FILE__) is much faster than searching the include path. dirname() is a string only operator withouth filesystem access. If you reply on an include path with lots of paths in there PHp will try to find a file in every one of them, this involves file access which makes it slow. Derick -- --------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --------------[ if you hold a unix shell to your ear, do you hear the c? ]-

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