RE: [PEAR-DEV] include path solution?
| From: | Lukas Smith | Date: | Thu, 07 Nov 2002 22:30:37 +0000 |
| Subject: | RE: [PEAR-DEV] include path solution? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10598@lists.php.net to get a copy of this message | ||
> 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
..?
> 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.
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).
According to Derick bytecode compilers do handle files stored in include
paths correctly ... so I lost that argument for my side ...
Oh well I can always "use the source" ..
Regards,
Lukas