Re: re: ini_set() / Jason Wong / dynamically setting this?
| From: | David T-G | Date: | Tue, 03 Dec 2002 20:21:44 +0000 |
| Subject: | Re: re: ini_set() / Jason Wong / dynamically setting this? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126896@lists.php.net to get a copy of this message | ||
Matt --
..and then Matt Babineau said...
%
% Hi everyone:
Hi!
..
%
% I am working on a website, and I have a shared hosting account on a
% win2k machine. When I upload from my local machine to the shared hosting
% machine I have to change a variable on each of my pages that gives me
% the proper path to including the necessary files to execute the page
% properly. If I don't I get an error.
What I've done is put a bit of code in each of my scripts
# this will let us figure out where we are and then always source the right include stuff!
# it does not work with symlinks (__FILE__ reports the *target*)
# you must have a full env tree in your devel tree; we now look exclusively in $DEVELDIR if set
if ( ereg("/home/sites/\.php/",__FILE__) ) # are we *somewhere* in our usual master
tree?
{ $DEVELDIR =
preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","\\1",__FILE__) ; } # get the
working dir
and then I work from my base development tree with a
include("/home/sites/.php$DEVELDIR/includestuff.inc"); # include our various files
require("/home/sites/.php$DEVELDIR/ImageInformation.class.php");
and away I go. I replicate my build directory anywhere under the .php
dir and everything else knows where it is and thus where to find the
other files in the same version.
This may be helpful; good luck!
HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!