"dan nessett" <[email protected]> wrote in message 
news:[email protected]...
> Brion Vibber <[email protected]> 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) 



_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to