Brion,
Thank you for replying.
* Look in $_SERVER yourself for all the exciting
variables it contains
I am experiencing very odd behavior when trying to use
$_SERVER within
MediaWiki.
First, I made a test.php script containing only this:
echo dirname($_SERVER[PHP_SELF]) . "<br />";
And when I run the script, it returns:
/web_sites/gutteridge.info/web
That is what I want it to return. I should therefor be able to use
dirname($_SERVER[PHP_SELF]) to get the correct path, regardless of the
server's local path particulars.
However, this did not work when I tried to actually implement it.
In LocalSettings.php, I've set the $wgScriptPath as so:
$wgScriptPath = dirname($_SERVER[PHP_SELF]);
Right under it, so that I could verify that the variable is being set to
what I want it to return, I put right underneath:
echo "<br />" . $wgScriptPath . "<br/>";
This should make it so that the contents of $wgScriptPath appear
somewhere near the top of the page when I go to the top page of my
MediaWiki. And it does. But, that reveals that the contents of
$wgScriptPath are:
/web_sites/gutteridge.info/web/index.php
So, the bottom line is that when I run dirname() inside a PHP script of
my own making, it behaves as expected in that it returns only the name
of the path.
But, when I run dirname() within the MediaWiki PHP code, it does not do
what it's supposed to do. It does not return only the path, it returns
the path plus the name of the script which contains it.
Why, and how, would MediaWiki break the behaviour of this PHP command?
And how do I stop it from doing that?
--
Dave M G