Removed left over uses of dirname( __FILE__ ) to __DIR__, even in comments.
Running the PHP version test in maintenance/Maintenance.php earlier, so that
we no longer have to stay PHP < 5.3 compatible in there.
Change-Id: I5a00bd5c6af44b7f826c4e5576a7b3de7b5026d8
refers to the link source, NOT to the target! You should check the env
variable MW_INSTALL_PATH in case the extension is not in the default location.
-The following code snippet let you override the default path:
+The following code snippet lets you override the default path:
$IP = getenv( 'MW_INSTALL_PATH' );
if( $IP === false ) {
- $IP = dirname( __FILE__ ) . '/../..';
+ $IP = __DIR__ . '/../..';
}
require_once( "$IP/maintenance/Maintenance.php" ); // a MediaWiki core file
*
* @par Example:
* @code
- * $wgExtensionMessagesFiles['ConfirmEdit'] = dirname(__FILE__).'/ConfirmEdit.i18n.php';
+ * $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
* @endcode
*/
$wgExtensionMessagesFiles = array();
/**
* Unicode and normalisation related
*/
-require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
+require_once __DIR__.'/normal/UtfNormalDefines.php';
/**@{
* Hook support constants
* @ingroup Deployment
*/
-require_once( dirname(__FILE__) . '/../../maintenance/Maintenance.php' );
+require_once( __DIR__ . '/../../maintenance/Maintenance.php' );
/**
* Class for handling database updates. Roughly based off of updaters.inc, with
*/
static function loadData() {
if( !isset( self::$utfCombiningClass ) ) {
- require_once( dirname(__FILE__) . '/UtfNormalData.inc' );
+ require_once( __DIR__ . '/UtfNormalData.inc' );
}
}
}
function loadDefaultTables() {
- // require( dirname(__FILE__)."/../../includes/KkConversion.php" );
+ // require( __DIR__."/../../includes/KkConversion.php" );
// Placeholder for future implementing. Remove variables declarations
// after generating KkConversion.php
$kk2Cyrl = array();
* @defgroup Maintenance Maintenance
*/
+// Make sure we're on PHP5 or better
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+ require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+ wfPHPVersionError( 'cli' );
+}
+
/**
* @defgroup MaintenanceArchive Maintenance archives
* @ingroup Maintenance
*/
// Define this so scripts can easily find doMaintenance.php
-define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' );
+define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
$maintClass = false;
-// Make sure we're on PHP5 or better
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
- require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
- wfPHPVersionError( 'cli' );
-}
/**
* Abstract maintenance class for quickly writing and churning out
* @param $exif bool Treat the EXIF messages?
*/
function __construct( $exif = true ) {
- require( dirname(__FILE__) . '/messageTypes.inc' );
+ require( __DIR__ . '/messageTypes.inc' );
$this->mIgnoredMessages = $wgIgnoredMessages;
if ( $exif ) {
$this->mOptionalMessages = array_merge( $wgOptionalMessages );
* @license GNU General Public License 2.0 or later
*/
-require_once( dirname(__FILE__) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to parse some wikitext.
* @file
*/
-require_once( dirname(__FILE__) . '/includes/WebStart.php' );
+require_once( __DIR__ . '/includes/WebStart.php' );
if( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
// Makes testing tweaks about a billion times easier
if ( !defined( 'MEDIAWIKI' ) ) {
$wgNoDBParam = true;
$optionsWithArgs = array( 'o' );
- require_once( dirname(__FILE__).'/../maintenance/commandLine.inc' );
+ require_once( __DIR__ .'/../maintenance/commandLine.inc' );
$stderr = fopen( 'php://stderr', 'w' );
if ( !isset( $args[0] ) ) {
die( -1 );
/** */
-require_once( dirname(__FILE__) . '/MonoBook.php' );
+require_once( __DIR__ . '/MonoBook.php' );
/**
* Inherit main code from SkinTemplate, set the CSS and template filter.
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
$this->assertTrue( $this->isElementPresent( "submit-back" ));
$this->assertTrue( $this->isElementPresent( "submit-continue" ));
}
-}
\ No newline at end of file
+}
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
require_once ( __DIR__ . '/MediaWikiInstallationConfig.php' );
-require_once ( dirname(__FILE__) . '/MediaWikiInstallationMessage.php' );
-require_once ( dirname(__FILE__) . '/MediaWikiInstallationVariables.php');
+require_once ( __DIR__ . '/MediaWikiInstallationMessage.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationVariables.php');
class MediaWikiInstallationCommonFunction extends PHPUnit_Extensions_SeleniumTestCase {
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
$this->chooseCancelOnNextConfirmation();
parent::restartInstallation();
}
-}
\ No newline at end of file
+}
*
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan)