r92853 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92852‎ | r92853 | r92854 >
Date:10:05, 22 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Fixed scoping issues by moving require()
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/MWScript.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/MWScript.php
@@ -17,9 +17,9 @@
1818 * Also, $argv[1] (the script path) will be changed to the script file name.
1919 * All other arguments will be preserved.
2020 *
21 - * @return void
 21+ * @return string Absolute MediaWiki script path
2222 */
23 -function runMWScript() {
 23+function getMWScriptWithArgs() {
2424 global $argv;
2525 if ( count( $argv ) < 2 ) {
2626 die( "The MediaWiki script file path must be the first argument.\n" );
@@ -45,8 +45,8 @@
4646 die( "The MediaWiki script file \"{$file}\" does not exist.\n" );
4747 }
4848
49 - # Run the script! (for HipHip, we will need to shell out here)
50 - require_once( $file );
 49+ return $file;
5150 }
5251
53 -runMWScript();
 52+# Run the script! (for HipHip, we will need to shell out here)
 53+require_once( getMWScriptWithArgs() );

Status & tagging log