MediaWiki  REL1_24
runScript.php
Go to the documentation of this file.
00001 <?php
00038 $IP = getenv( 'MW_INSTALL_PATH' );
00039 
00040 if ( $IP === false ) {
00041     $IP = dirname( __DIR__ );
00042 
00043     putenv( "MW_INSTALL_PATH=$IP" );
00044 }
00045 
00046 require_once "$IP/maintenance/Maintenance.php";
00047 
00048 if ( !isset( $argv[1] ) ) {
00049     fwrite( STDERR, "This script requires a maintainance script as an argument.\n"
00050         . "Usage: runScript.php extensions/Wikibase/lib/maintenance/dispatchChanges\n" );
00051     exit( 1 );
00052 }
00053 
00054 $scriptFilename = $argv[1];
00055 array_shift( $argv );
00056 
00057 $scriptFile = realpath( $scriptFilename );
00058 
00059 if ( !$scriptFile ) {
00060     fwrite( STDERR, "The MediaWiki script file \"{$scriptFilename}\" does not exist.\n" );
00061     exit( 1 );
00062 }
00063 
00064 require_once $scriptFile;