X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=91a027ee4e86def187fee75a408c9c67953090b2;hb=2a50911747f377d3eacb2f465fc6eb9987532fcb;hp=0023c6d8adf6029d972c3f31b9615bb1e1aca430;hpb=73c6a7e4dca80bf487283361130a3ed27c592948;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 0023c6d8ad..91a027ee4e 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -477,15 +477,20 @@ abstract class Maintenance { * Do some sanity checking and basic setup */ public function setup() { - global $wgCommandLineMode, $wgRequestTime; + global $IP, $wgCommandLineMode, $wgRequestTime; # Abort if called from a web server if ( isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] ) ) { $this->error( 'This script must be run from the command line', true ); } + if ( $IP === null ) { + $this->error( "\$IP not set, aborting!\n" . + '(Did you forget to call parent::__construct() in your maintenance script?)', 1 ); + } + # Make sure we can handle script parameters - if ( !function_exists( 'hphp_thread_set_warmup_enabled' ) && !ini_get( 'register_argc_argv' ) ) { + if ( !defined( 'HPHP_VERSION' ) && !ini_get( 'register_argc_argv' ) ) { $this->error( 'Cannot get command line arguments, register_argc_argv is set to false', true ); } @@ -782,7 +787,6 @@ abstract class Maintenance { $this->output( "\n" ); } - // Script specific parameters not defined on construction by // Maintenance::addDefaultParams() $scriptSpecificParams = array_diff_key(