Use __DIR__ instead of dirname( __FILE__ )
authorHoo man <hoo@online.de>
Mon, 27 Aug 2012 21:58:28 +0000 (23:58 +0200)
committerHoo man <hoo@online.de>
Mon, 27 Aug 2012 21:58:28 +0000 (23:58 +0200)
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

21 files changed:
extensions/README
includes/DefaultSettings.php
includes/Defines.php
includes/installer/DatabaseUpdater.php
includes/normal/UtfNormal.php
languages/classes/LanguageKk.php
maintenance/Maintenance.php
maintenance/language/languages.inc
maintenance/parse.php
opensearch_desc.php
serialized/serialize.php
skins/Simple.php
tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php
tests/selenium/installer/MediaWikiInstallationCommonFunction.php
tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php
tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php
tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php
tests/selenium/installer/MediaWikiRestartInstallationTestCase.php
tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php
tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php
tests/selenium/installer/MediaWikiUserInterfaceTestCase.php

index 22f4710..e810286 100644 (file)
@@ -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
index c58746b..045eb98 100644 (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();
index 55d9a7a..be9f981 100644 (file)
@@ -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
index d989427..ff0a99e 100644 (file)
@@ -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
index 2b400e5..08f85bd 100644 (file)
@@ -190,7 +190,7 @@ class UtfNormal {
         */
        static function loadData() {
                if( !isset( self::$utfCombiningClass ) ) {
-                       require_once( dirname(__FILE__) . '/UtfNormalData.inc' );
+                       require_once( __DIR__ . '/UtfNormalData.inc' );
                }
        }
 
index 5cf1afd..de0f4ff 100644 (file)
@@ -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();
index af549d7..6da5815 100644 (file)
  * @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
index 15fa712..b76f921 100644 (file)
@@ -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 );
index c1a890b..b0ab624 100644 (file)
@@ -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.
index 630b05c..95f028a 100644 (file)
@@ -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
index d8fb2b3..0e0ce80 100644 (file)
@@ -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] ) ) {
index d06bdfd..9a3ab94 100644 (file)
@@ -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.
index bf5b379..8bca4b0 100644 (file)
@@ -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" ));
     }
-}
\ No newline at end of file
+}
index 9e60391..353fa2e 100644 (file)
@@ -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 {
index 399ed4e..16d065c 100644 (file)
@@ -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)
index f57c1a5..4ca6916 100644 (file)
@@ -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)
index 4c05266..7a1b615 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 
 /**
index b9ca830..ea87de0 100644 (file)
@@ -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)
index 700172c..7b0fcf3 100644 (file)
@@ -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)
index eb82071..5cdc8d4 100644 (file)
@@ -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();
     }
-}
\ No newline at end of file
+}
index 0994892..15fad95 100644 (file)
@@ -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)