Re: Setting include path to same directory as .php file.?
| From: | Cynic | Date: | Thu, 07 Dec 2000 14:01:30 +0000 |
| Subject: | Re: Setting include path to same directory as .php file.? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29129@lists.php.net to get a copy of this message | ||
of course, i meant to write
ini_set( 'include_path' , ini_get( 'include_path' ) . ':'
. basename( $HTTP_SERVER_VARS['PATH_TRANSLATED'] ) )
BTW, if you plan to let other people use the script, you
should check for the server's system first, as windows-style
path separator is ';', not ':'. Maybe even translate slashes
in the path to escaped backslashes if on win9x, dunno.
At 14:46 7.12. 2000, Cynic wrote the following:
--------------------------------------------------------------
>Another confused post:
>
>Judging from the subject line, you want to do something like
>
>ini_set( ini_get( 'include_path' ) . ':' . basename(
>$HTTP_SERVER_VARS['PATH_TRANSLATED'] ) )
>
>Am I right?
>
>
>At 06:54 7.12. 2000, Dan Lowe wrote the following:
>--------------------------------------------------------------
>>Previously, Daniel Convissor said:
>>>
>>> I don't quite understand the implications of what you're saying.
>>> Regardless of where things are, you need to call the includes relative to
>>> the directory where the initial page is called from. As mentioned in a
>>> reply to another post of yours on this subject, I suggest using variables
>>> set in the initial file then using that variable name in all subsequent
>>> include requests.
>>>
>>> If I'm misunderstanding you, please post clarification to the list.
>>
>>Well, I may be misunderstanding you also, but here's some more info.
>>
>>Basically, there is the package called PHP-Nuke (www.phpnuke.org) and I
>>have a smaller package MiG (www.tangledhelix.com/software/mig) and I have
>>created a plugin "mode" for my package to be an add-on for PHP-Nuke.
>>
>>The issue was that the initial version dumped itself, potentially, in the
>>root directory of the PHP-Nuke install. That doesn't work out very well
>>because admittedly my installer likes to litter a bit. So the best thing
>>to do is to have it in a subdirectory (such as {root}/mig/) so that I do
>>not interfere with or trample on anything in the PHP-Nuke root directory.
>>
>>My script, when in compatibility mode, include()'s some PHP-Nuke standard
>>files with very simple calls:
>>
>> if ($phpNukeMode)
>> include("../header.php");
>>
>> [... other stuff...]
>>
>> if ($phpNukeMode)
>> include("../footer.php");
>>
>>The problem is that header.php goes on to include other files itself, and
>>it is assuming they'll be in "." or in include_path (neither of which is
>>"../". So it doesn't work.
>>
>>Since I don't control the files I am including, there's nothing I can do to
>>make them use a different path to include the files they are including.
>>
>>What I've done for now is leave the 'main' bit of my code in the PHP-Nuke
>>root and isolate the rest of the package into a subdirectory. But ideally
>>I would rather have everything of mine in a subdirectory, if possible.
>>
>>I hope that clears up any confusion from my earlier posts.
>>
>> -dan
>>
>>--
>>Dan Lowe <dan@tangledhelix.com>
>>http://tangledhelix.com/
>>
>>Do infants enjoy infancy as much as adults enjoy adultery?
>> -George Carlin
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>>For additional commands, e-mail: php-general-help@lists.php.net
>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>------end of quote------
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>cynic@mail.cz
>ICQ: 2808 2505
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz
ICQ: 2808 2505