On Tue, Aug 11, 2009 at 1:50 PM, dan nessettdnessett@yahoo.com wrote:
I want to avoid seeming obsessed by this issue, but file position dependent code is a significant generator of bugs in other software.
It has never generated any bugs for us that I can recall. A poorly-written testing framework that no one ever used anyway doesn't count.
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.
If the user has root access, then we can install MediaWiki into a definite location. If they don't, we have to figure out the location, because it could be anywhere. We can't centralize this code because to do so we'd have to already know where the include path is. It's really very simple; there's no way out of it. The problem is only a few lines of code duplicated, it's really not very serious.