MediaWiki  master
runScript.php
Go to the documentation of this file.
1 <?php
38 $IP = getenv( 'MW_INSTALL_PATH' );
39 
40 if ( $IP === false ) {
41  $IP = dirname( __DIR__ );
42 
43  putenv( "MW_INSTALL_PATH=$IP" );
44 }
45 
46 require_once "$IP/maintenance/Maintenance.php";
47 
48 if ( !isset( $argv[1] ) ) {
49  fwrite( STDERR, "This script requires a maintenance script as an argument.\n"
50  . "Usage: runScript.php extensions/Wikibase/lib/maintenance/dispatchChanges\n" );
51  exit( 1 );
52 }
53 
54 $scriptFilename = $argv[1];
55 array_shift( $argv );
56 
57 $scriptFile = realpath( $scriptFilename );
58 
59 if ( !$scriptFile ) {
60  fwrite( STDERR, "The MediaWiki script file \"{$scriptFilename}\" does not exist.\n" );
61  exit( 1 );
62 }
63 
64 require_once $scriptFile;
$IP
Definition: runScript.php:38
$scriptFile
Definition: runScript.php:57
if(!isset( $argv[1])) $scriptFilename
Definition: runScript.php:54