r61087 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61086‎ | r61087 | r61088 >
Date:16:55, 15 January 2010
Author:ialex
Status:ok
Tags:
Comment:
* use require_once for ProfilerStub.php, GlobalFunctions.php and Hooks.php, these files might already be loaded when reaching this point
* always use the complete path (with $IP) when loading files with require(_once)
* include AutoLoader before LocalSettings.php as we do in WebStart.php
* don't load DefaultSettings.php, it's already done by LocalSettings.php
* define MW_PHPUNIT_TEST constant
* added a description for the file
Modified paths:
  • /trunk/phase3/tests/bootstrap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/bootstrap.php
@@ -1,16 +1,24 @@
22 <?php
33
 4+/**
 5+ * Set up the MediaWiki environment when running tests with "phpunit" command
 6+ *
 7+ * Warning: this file is not included from global scope!
 8+ * @file
 9+ */
 10+
411 global $wgCommandLineMode, $IP;
512 $wgCommandLineMode = true;
613 $IP = dirname( dirname( __FILE__ ) );
7 -define('MEDIAWIKI', 1);
 14+
 15+define( 'MEDIAWIKI', true );
 16+define( 'MW_PHPUNIT_TEST', true );
817 ini_set( 'include_path', "$IP:" .ini_get( 'include_path' ) );
918
10 -require ( "$IP/includes/Defines.php" );
11 -require ( "$IP/includes/DefaultSettings.php" );
12 -require ( "$IP/LocalSettings.php" );
 19+require "$IP/includes/Defines.php";
 20+require "$IP/includes/AutoLoader.php";
 21+require "$IP/LocalSettings.php";
1322
14 -require 'ProfilerStub.php';
15 -require 'GlobalFunctions.php';
16 -require 'Hooks.php';
17 -require 'AutoLoader.php';
 23+require_once "$IP/includes/ProfilerStub.php";
 24+require_once "$IP/includes/GlobalFunctions.php";
 25+require_once "$IP/includes/Hooks.php";

Status & tagging log