3 * Convenience maintenance script wrapper, useful for scripts
4 * or extensions located outside of standard locations.
6 * To use, give the maintenance script as a relative or full path.
10 * If your pwd is mediawiki base folder:
11 * php maintenance/runScript.php extensions/Wikibase/lib/maintenance/dispatchChanges.php
13 * If your pwd is maintenance folder:
14 * php runScript.php ../extensions/Wikibase/lib/maintenance/dispatchChanges.php
17 * php /var/www/mediawiki/maintenance/runScript.php maintenance/runJobs.php
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License along
30 * with this program; if not, write to the Free Software Foundation, Inc.,
31 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32 * http://www.gnu.org/copyleft/gpl.html
34 * @author Katie Filbert < aude.wiki@gmail.com >
36 * @ingroup Maintenance
38 $IP = getenv( 'MW_INSTALL_PATH' );
40 if ( $IP === false ) {
41 $IP = dirname( __DIR__
);
43 putenv( "MW_INSTALL_PATH=$IP" );
46 require_once "$IP/maintenance/Maintenance.php";
48 if ( !isset( $argv[1] ) ) {
49 fwrite( STDERR
, "This script requires a maintainance script as an argument.\n"
50 . "Usage: runScript.php extensions/Wikibase/lib/maintenance/dispatchChanges\n" );
54 $scriptFilename = $argv[1];
57 $scriptFile = realpath( $scriptFilename );
60 fwrite( STDERR
, "The MediaWiki script file \"{$scriptFilename}\" does not exist.\n" );
64 require_once $scriptFile;