On Tue, Aug 11, 2009 at 12:00 PM, dan nessett<[email protected]> wrote: > --- On Tue, 8/11/09, Chad <[email protected]> wrote: > >> >> The problem with "putting it in a single function" is you >> still have >> to find where that function is to begin with (I'd assume >> either >> GlobalFunctions or install-utils would define this). At >> which point >> you're back to the original problem: defining $IP yourself >> so you >> can find this. >> >> Yes, we should probably do this all a little more cleanly >> (at least >> one unified style would be nice), but constructing it >> manually is >> pretty much a given for anything trying to find an entry >> point, as >> Tim points out. > > I'm probably missing something since I have only been programming in PHP for > about 4 weeks, but if you set include_path in php.ini so it includes the root > of the MW tree, put a php file at that level that has a function (or a method > in a class) that returns the MW root path, wouldn't that work? For example, > if you modified include_path in php.ini to include <pathname to MW root>, > added the file MWInit.php to the MW root directory and in MWInit.php put a > function MWInit() that computes and returns $IP, wouldn't that eliminate the > necessity of manually figuring out the value of $IP [each place where you now > compute $IP could require_once('MWInit.php') and call MWInit()]? > > Of course, it may be considered dangerous for the MW installation software to > fool around with php.ini. But, even if you require setting the MW root > manually in php.ini::include_path (abusing the php namespace disambiguation > operator here) that would be an improvement. You should only have to do this > once and could upgrade MW without disturbing this binding. > > > > > _______________________________________________ > Wikitech-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/wikitech-l >
That requires you setting the include path, at which point you _STILL_ have to figure out where $IP is to begin with. $IP stands for "include path" and is the path to the wiki root where index.php, etc resides. We need this value to set in include_path, not expect it to already be there. Nor can we expect users to edit php.ini just to add MW to their include path just to avoid us constructing $IP manually. -Chad _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
