Re: dirname(__FILE__)

From: Date: Thu, 22 Sep 2005 07:38:06 +0000
Subject: Re: dirname(__FILE__)
References: 1 2  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-3067@lists.php.net to get a copy of this message
On Tue Sep 20, 2005 at 10:3305PM -0700, Justin Patrin wrote: > On 9/20/05, Markus Albe <malbe@adinet.com.uy> wrote: > > Why not make mandatory the use of "dirname(__FILE__)" prepended to > > includes of other PEAR libraries? > > Aside from the fact that this solution is less elegant and more > verbose, it really doesn't add any real value. Aside from that there is also a performance issue involved: Calling dirname() involves (IIRC) quite a few realpath() calls behind the scenes, which are relatively expensive in terms of system performance. The recently introduced PHP realpath cache should solve this problem to a certain extent, but dirname() still isn't the best idea for busy environments. - Martin

« previous php.pear.qa (#3067) next »