On 8/11/09 9:57 AM, dan nessett wrote:
The question may arise, how do you get the value of the MW root into MWInit.php in the first place? This can occur on MW installation. Of course, there may be a problem getting MWInit.php into the PEAR directory, but I assume that is an easier task than modifying php.ini. However, if even this is a problem, then we can do what Dmitry suggests, set an environmental variable to the MW root path.
You shouldn't assume you can set environment variables either. :)
Really, MediaWiki is built to assume it's being run from the base directory where its files are found.
I'm not sure there's a compelling reason to even have $IP set in LocalSettings.php anymore; the base include path should probably be autodetected in all cases, which is already being done in WebStart.php and commandLine.inc, the web and CLI initialization includes based on their locations in the file tree.
Unless there's some reason to do otherwise, I'd recommend dropping the $IP from the autogen'd LocalSettings.php and pulling in DefaultSettings.php from the level above. (Keeping in mind that we should retain compat with existing LocalSettings.php files that are still pulling it.)
Having $IP in there is a frequent source of upgrade problems as people move their filesystem paths around and then discover that their new MediaWiki install is trying to load files from the old one in another directory.
-- brion