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