RE: [PEAR-DEV] include path solution?

From: Date: Fri, 08 Nov 2002 07:05:57 +0000
Subject: RE: [PEAR-DEV] include path solution?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10606@lists.php.net to get a copy of this message
On Thu, 2002-11-07 at 23:30, Lukas Smith wrote: > > From: Stig S. Bakken [mailto:ssb@fast.no] > > Sent: Thursday, November 07, 2002 10:59 PM > > > > The basic difference between using a constant and include_path is that > > you can not change the constant, and using a constant adds a lot of > > hassle while taking away lots of flexibility. I don't buy the > > performance argument, if you have exactly one directory in your > > include_path there is no difference. > > Hmm maybe I am missing something here .. but I want the constant to be > user defined .. so where is the lack of flexibility? I doubt people > would be switching back and forth on their pear path in one script call > ..? I'm not talking about switching back and forth, but rather adding another include directory at times. How would you give your script the possibility of including from two include trees (for example your own, and the system-installed as fallback) using a constant? > > And once again, include_once was added to PHP to provide exactly this > > abstraction (between relative package file name and actual location) > in > > a persistent way. > > Well but obviously in the current state it cannot prevent multiple > includes on the same file if you use different relative include paths to > the same file. So I think it would be best to just ensure to always use > the same include path. But a single include path is not a solution for many people. > I just think it is messy to not point to a specific file and instead let > PHP search for it (especially if you have multiple directories in the > include path). You might see this as "messy", I see it as a feature providing necessary flexibility. > According to Derick bytecode compilers do handle files stored in include > paths correctly ... so I lost that argument for my side ... If a compiler did not handle this, that'd be a bug in the compiler. - Stig -- Stig Sæther Bakken, Fast Search & Transfer ASA, Trondheim, Norway http://pear.php.net/wishlist.php/ssb

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