Use __DIR__ instead of dirname( __FILE__ )
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
This commit is contained in:
parent
db705be9f6
commit
8ffbb077b3
21 changed files with 31 additions and 30 deletions
|
|
@ -21,10 +21,10 @@ Please note that under POSIX systems (Linux...), parent of a symbolic path
|
|||
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
|
||||
|
|
|
|||
|
|
@ -5212,7 +5212,7 @@ $wgExtensionFunctions = array();
|
|||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* $wgExtensionMessagesFiles['ConfirmEdit'] = dirname(__FILE__).'/ConfirmEdit.i18n.php';
|
||||
* $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
|
||||
* @endcode
|
||||
*/
|
||||
$wgExtensionMessagesFiles = array();
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ define( 'LIST_SET_PREPARED', 8); // List of (?, ?, ?) for DatabaseIbm_db2
|
|||
/**
|
||||
* Unicode and normalisation related
|
||||
*/
|
||||
require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
|
||||
require_once __DIR__.'/normal/UtfNormalDefines.php';
|
||||
|
||||
/**@{
|
||||
* Hook support constants
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
* @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
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ class UtfNormal {
|
|||
*/
|
||||
static function loadData() {
|
||||
if( !isset( self::$utfCombiningClass ) ) {
|
||||
require_once( dirname(__FILE__) . '/UtfNormalData.inc' );
|
||||
require_once( __DIR__ . '/UtfNormalData.inc' );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class KkConverter extends LanguageConverter {
|
|||
}
|
||||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -20,22 +20,23 @@
|
|||
* @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
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class languages {
|
|||
* @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 );
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
* @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.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
* @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
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
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] ) ) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ if( !defined( 'MEDIAWIKI' ) )
|
|||
die( -1 );
|
||||
|
||||
/** */
|
||||
require_once( dirname(__FILE__) . '/MonoBook.php' );
|
||||
require_once( __DIR__ . '/MonoBook.php' );
|
||||
|
||||
/**
|
||||
* Inherit main code from SkinTemplate, set the CSS and template filter.
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
|
||||
require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
|
||||
/**
|
||||
* Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
||||
|
|
@ -99,4 +99,4 @@ class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFu
|
|||
$this->assertTrue( $this->isElementPresent( "submit-back" ));
|
||||
$this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
|
||||
require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
|
||||
/**
|
||||
* Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
|
||||
require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
|
||||
/**
|
||||
* Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
|
||||
require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
|
||||
require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
|
||||
|
||||
/**
|
||||
* Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
||||
|
|
@ -114,4 +114,4 @@ class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationComm
|
|||
$this->chooseCancelOnNextConfirmation();
|
||||
parent::restartInstallation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue