"dan nessett" dnessett@yahoo.com wrote in message news:271560.93058.qm@web32504.mail.mud.yahoo.com...
Brion Vibber brion@wikimedia.org wrote:
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.)
Better, but what about /config/index.php, noMediaWikiConfig.php, validate.php and Maintenance.php? Having only two different places where $IP is computed is a definite improvement (assuming you fix the 4 files just mentioned), but it still means the code in WebStart.php and Command.inc is file position dependent. If this is the best that can be done, then that is that. However, it would really be better if all position dependent code could be eliminated.
To be honest, I don't know why there is more than one entry point at all. Surely it would be better if all requests went through index.php:
<?php //index.php - the only MW entry point
// First, do all stuff that is always required. $IP = realpath(dirname(__FILE__)); include($IP . "/LocalSettings.php"); //...and any other actions that should be performed in all cases...
if ( !isset( $_SERVER ) || !array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { include($IP . "/maintenance/commandLine.inc"); return; }
// Rest of index.php as current.
?>
Any maintenance scripts would then include("../index.php") instead of commandLine.inc, and voila - all code-duplication at the various entry points has been removed.
- Mark Clements (HappyDog)