On Tue, 11 Aug 2009, dan nessett wrote:
--- On Tue, 8/11/09, Aryeh Gregor <Simetrical+wikilist(a)gmail.com> wrote:
Then you're doing almost exactly the same
thing we're doing
now,
except with MWInit.php instead of LocalSettings.php.
$IP is normally
set in LocalSettings.php for most page views. Some
places still must
figure it out independently in either case, e.g.,
config/index.php.
I want to avoid seeming obsessed by this issue, but file position
dependent code is a significant generator of bugs in other software. The
difference between MWInit.php and LocalSettings.php is if you get the
former into a directory that PHP uses for includes, you have a way of
getting the root path of MW without the caller knowing anything about
the relative structure of the code distribution tree hierarchy. As you
pointed out previously, the reason you need to compute $IP before
including/requiring LocalSettings is you don't know where it is.
Dan
Placing it in the include path could make it hard to run more than one
version of the MW code on the same server, since both would probably find
the same file and one of them would likely end up using the other one's
$IP.
Another way of putting it is, is it really better to hard-code the
absolute position of the MW root rather than its position relative to the
files in it?
lw