Use __DIR__ instead of dirname( __FILE__ )
authorjeroendedauw <jeroendedauw@gmail.com>
Mon, 27 Aug 2012 19:03:15 +0000 (21:03 +0200)
committerjeroendedauw <jeroendedauw@gmail.com>
Mon, 27 Aug 2012 19:45:00 +0000 (21:45 +0200)
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1

246 files changed:
RELEASE-NOTES-1.20
api.php
docs/magicword.txt
img_auth.php
includes/CryptRand.php
includes/DefaultSettings.php
includes/SpecialPage.php
includes/WebStart.php
includes/installer/Installer.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerPage.php
includes/json/FormatJson.php
index.php
languages/Language.php
languages/classes/LanguageGan.php
languages/classes/LanguageIu.php
languages/classes/LanguageKk.php
languages/classes/LanguageKu.php
languages/classes/LanguageShi.php
languages/classes/LanguageSr.php
languages/classes/LanguageTg.php
languages/classes/LanguageUz.php
languages/classes/LanguageZh.php
load.php
maintenance/Maintenance.php
maintenance/archives/upgradeLogging.php
maintenance/attachLatest.php
maintenance/backupTextPass.inc
maintenance/benchmarks/Benchmarker.php
maintenance/benchmarks/bench_HTTP_HTTPS.php
maintenance/benchmarks/bench_delete_truncate.php
maintenance/benchmarks/bench_if_switch.php
maintenance/benchmarks/bench_strtr_str_replace.php
maintenance/benchmarks/bench_utf8_title_check.php
maintenance/benchmarks/bench_wfIsWindows.php
maintenance/benchmarks/benchmarkHooks.php
maintenance/benchmarks/benchmarkPurge.php
maintenance/cdb.php
maintenance/changePassword.php
maintenance/checkAutoLoader.php
maintenance/checkBadRedirects.php
maintenance/checkImages.php
maintenance/checkSyntax.php
maintenance/checkUsernames.php
maintenance/cleanupAncientTables.php
maintenance/cleanupCaps.php
maintenance/cleanupImages.php
maintenance/cleanupPreferences.php
maintenance/cleanupRemovedModules.php
maintenance/cleanupSpam.php
maintenance/cleanupTable.inc
maintenance/cleanupTitles.php
maintenance/cleanupUploadStash.php
maintenance/cleanupWatchlist.php
maintenance/clear_interwiki_cache.php
maintenance/clear_stats.php
maintenance/commandLine.inc
maintenance/compareParsers.php
maintenance/convertLinks.php
maintenance/convertUserOptions.php
maintenance/copyFileBackend.php
maintenance/createAndPromote.php
maintenance/deleteArchivedFiles.php
maintenance/deleteArchivedRevisions.php
maintenance/deleteBatch.php
maintenance/deleteDefaultMessages.php
maintenance/deleteImageMemcached.php
maintenance/deleteOldRevisions.php
maintenance/deleteOrphanedRevisions.php
maintenance/deleteRevision.php
maintenance/deleteSelfExternals.php
maintenance/dumpBackup.php
maintenance/dumpIterator.php
maintenance/dumpLinks.php
maintenance/dumpSisterSites.php
maintenance/dumpTextPass.php
maintenance/dumpUploads.php
maintenance/edit.php
maintenance/eval.php
maintenance/fetchText.php
maintenance/fileOpPerfTest.php
maintenance/findHooks.php
maintenance/fixDoubleRedirects.php
maintenance/fixExtLinksProtocolRelative.php
maintenance/fixSlaveDesync.php
maintenance/fixTimestamps.php
maintenance/fixUserRegistration.php
maintenance/formatInstallDoc.php
maintenance/fuzz-tester.php
maintenance/generateSitemap.php
maintenance/getLagTimes.php
maintenance/getSlaveServer.php
maintenance/getText.php
maintenance/hiphop/make
maintenance/hiphop/run-server
maintenance/importDump.php
maintenance/importImages.php
maintenance/importSiteScripts.php
maintenance/importTextFile.php
maintenance/initEditCount.php
maintenance/initStats.php
maintenance/install.php
maintenance/jsparse.php
maintenance/lag.php
maintenance/language/alltrans.php
maintenance/language/checkDupeMessages.php
maintenance/language/checkExtensions.php
maintenance/language/checkLanguage.php
maintenance/language/countMessages.php
maintenance/language/date-formats.php
maintenance/language/digit2html.php
maintenance/language/dumpMessages.php
maintenance/language/generateCollationData.php
maintenance/language/generateNormalizerData.php
maintenance/language/langmemusage.php
maintenance/language/rebuildLanguage.php
maintenance/language/transstat.php
maintenance/language/validate.php
maintenance/language/writeMessagesArray.inc
maintenance/mcc.php
maintenance/mctest.php
maintenance/mergeMessageFileList.php
maintenance/migrateUserGroup.php
maintenance/minify.php
maintenance/moveBatch.php
maintenance/mwdocgen.php
maintenance/namespaceDupes.php
maintenance/nextJobDB.php
maintenance/nukeNS.php
maintenance/nukePage.php
maintenance/oracle/alterSharedConstraints.php
maintenance/orphans.php
maintenance/patchSql.php
maintenance/populateCategory.php
maintenance/populateImageSha1.php
maintenance/populateLogSearch.php
maintenance/populateLogUsertext.php
maintenance/populateParentId.php
maintenance/populateRevisionLength.php
maintenance/populateRevisionSha1.php
maintenance/preprocessDump.php
maintenance/preprocessorFuzzTest.php
maintenance/protect.php
maintenance/pruneFileCache.php
maintenance/purgeDeletedFiles.php
maintenance/purgeList.php
maintenance/purgeOldText.php
maintenance/purgeParserCache.php
maintenance/purgeStaleMemcachedText.php
maintenance/reassignEdits.php
maintenance/rebuildFileCache.php
maintenance/rebuildImages.php
maintenance/rebuildLocalisationCache.php
maintenance/rebuildall.php
maintenance/rebuildmessages.php
maintenance/rebuildrecentchanges.php
maintenance/rebuildtextindex.php
maintenance/refreshImageCount.php
maintenance/refreshImageMetadata.php
maintenance/refreshLinks.php
maintenance/removeUnusedAccounts.php
maintenance/renameDbPrefix.php
maintenance/renderDump.php
maintenance/resetUserTokens.php
maintenance/rollbackEdits.php
maintenance/runBatchedQuery.php
maintenance/runJobs.php
maintenance/showJobs.php
maintenance/showStats.php
maintenance/sql.php
maintenance/sqlite.php
maintenance/stats.php
maintenance/storage/checkStorage.php
maintenance/storage/compressOld.php
maintenance/storage/dumpRev.php
maintenance/storage/fixBug20757.php
maintenance/storage/moveToExternal.php
maintenance/storage/orphanStats.php
maintenance/storage/recompressTracked.php
maintenance/storage/resolveStubs.php
maintenance/storage/storageTypeStats.php
maintenance/storage/testCompression.php
maintenance/storage/trackBlobs.php
maintenance/syncFileBackend.php
maintenance/undelete.php
maintenance/update.php
maintenance/updateArticleCount.php
maintenance/updateCollation.php
maintenance/updateDoubleWidthSearch.php
maintenance/updateRestrictions.php
maintenance/updateSearchIndex.php
maintenance/updateSpecialPages.php
maintenance/upgrade1_5.php
maintenance/userOptions.inc
maintenance/waitForSlave.php
mw-config/index.php
profileinfo.php
redirect.php
tests/RunSeleniumTests.php
tests/TestsAutoLoader.php
tests/jasmine/spec_makers/makeJqueryMsgSpec.php
tests/parserTests.php
tests/phpunit/MediaWikiPHPUnitCommand.php
tests/phpunit/bootstrap.php
tests/phpunit/includes/TemplateCategoriesTest.php
tests/phpunit/includes/ZipDirectoryReaderTest.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/api/generateRandomImages.php
tests/phpunit/includes/db/TestORMRowTest.php
tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
tests/phpunit/includes/media/ExifRotationTest.php
tests/phpunit/includes/media/ExifTest.php
tests/phpunit/includes/media/FormatMetadataTest.php
tests/phpunit/includes/media/GIFMetadataExtractorTest.php
tests/phpunit/includes/media/GIFTest.php
tests/phpunit/includes/media/JpegMetadataExtractorTest.php
tests/phpunit/includes/media/JpegTest.php
tests/phpunit/includes/media/PNGMetadataExtractorTest.php
tests/phpunit/includes/media/PNGTest.php
tests/phpunit/includes/media/SVGMetadataExtractorTest.php
tests/phpunit/includes/media/TiffTest.php
tests/phpunit/includes/media/XMPTest.php
tests/phpunit/includes/parser/MediaWikiParserTest.php
tests/phpunit/includes/parser/PreprocessorTest.php
tests/phpunit/includes/upload/UploadStashTest.php
tests/phpunit/languages/LanguageSrTest.php
tests/phpunit/languages/LanguageUzTest.php
tests/phpunit/maintenance/backupPrefetchTest.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/phpunit/maintenance/fetchTextTest.php
tests/phpunit/maintenance/getSlaveServerTest.php
tests/phpunit/phpunit.php
tests/phpunit/suites/UploadFromUrlTestSuite.php
tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php
tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php
tests/selenium/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php
tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php
tests/selenium/installer/MediaWikiHelpFieldHintTestCase.php
tests/selenium/installer/MediaWikiInstallationCommonFunction.php
tests/selenium/installer/MediaWikiInstallerTestSuite.php
tests/selenium/suites/MediawikiCoreSmokeTestCase.php
tests/selenium/suites/MyContributionsTestCase.php
tests/selenium/suites/MyWatchListTestCase.php
thumb.php
thumb_handler.php

index 92f050e..e06dc7d 100644 (file)
@@ -293,6 +293,7 @@ changes to languages because of Bugzilla reports.
 * Deprecated mw.user.anonymous in favour of mw.user.isAnon.
 * Deprecated DatabaseBase functions newFromParams(), newFromType(), set(),
   quote_ident(), and escapeLike() were removed.
+* Use of __DIR__ instead of dirname( __FILE__ ).
 
 == Compatibility ==
 
diff --git a/api.php b/api.php
index 9e1f5dd..ad420ff 100644 (file)
--- a/api.php
+++ b/api.php
@@ -43,7 +43,7 @@ if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'core/includes/WebStart.php' );
 } else {
-       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require ( __DIR__ . '/includes/WebStart.php' );
 }
 
 wfProfileIn( 'api.php' );
index ceae026..1d9bf7d 100644 (file)
@@ -40,7 +40,7 @@ $magicWords['es'] = array(
 );
 ----
 
-$wgExtensionMessagesFiles['ExtensionNameMagic'] = dirname( __FILE__ ) . '/ExtensionName.i18n.magic.php';
+$wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
 $wgHooks['MagicWordwgVariableIDs'][] = 'wfAddCustomMagicWordID';
 $wgHooks['ParserGetVariableValueSwitch'][] = 'wfGetCustomMagicWordValue';
 
@@ -74,7 +74,7 @@ $magicWords['es'] = array(
 );
 ----
 
-$wgExtensionMessagesFiles['ExtensionNameMagic'] = dirname( __FILE__ ) . '/ExtensionName.i18n.magic.php';
+$wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
 $wgHooks['ParserFirstCallInit'][] = 'wfRegisterCustomMagicWord';
 
 function wfRegisterCustomMagicWord( &$parser ){
index 74602f2..b3a3495 100644 (file)
@@ -43,7 +43,7 @@ define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'core/includes/WebStart.php' );
 } else {
-       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require ( __DIR__ . '/includes/WebStart.php' );
 }
 wfProfileIn( 'img_auth.php' );
 
index bb80eeb..858eebf 100644 (file)
@@ -83,8 +83,8 @@ class MWCryptRand {
                $files[] = __FILE__;
 
                // We must also have a parent folder, and with the usual file structure, a grandparent
-               $files[] = dirname( __FILE__ );
-               $files[] = dirname( dirname( __FILE__ ) );
+               $files[] = __DIR__;
+               $files[] = dirname( __DIR__ );
 
                // The config file is likely the most often edited file we know should be around
                // so include its stat info into the state.
index 3ea35d5..c58746b 100644 (file)
@@ -2760,7 +2760,7 @@ $wgShowRollbackEditCount = 10;
  *      'scripts' => 'myExtension.js',
  *      'styles' => 'myExtension.css',
  *      'dependencies' => array( 'jquery.cookie', 'jquery.tabIndex' ),
- *      'localBasePath' => dirname( __FILE__ ),
+ *      'localBasePath' => __DIR__,
  *      'remoteExtPath' => 'MyExtension',
  *   );
  * @endcode
index e2932e1..2e5e02b 100644 (file)
@@ -351,7 +351,7 @@ class SpecialPage {
                        $this->mFunction = $function;
                }
                if ( $file === 'default' ) {
-                       $this->mFile = dirname( __FILE__ ) . "/specials/Special$name.php";
+                       $this->mFile = __DIR__ . "/specials/Special$name.php";
                } else {
                        $this->mFile = $file;
                }
index 17f8216..01c5eea 100644 (file)
@@ -81,7 +81,7 @@ define( 'MEDIAWIKI', true );
 # Full path to working directory.
 # Makes it possible to for example to have effective exclude path in apc.
 # Also doesn't break installations using symlinked includes, like
-# dirname( __FILE__ ) would do.
+# __DIR__ would do.
 $IP = getenv( 'MW_INSTALL_PATH' );
 if ( $IP === false ) {
        $IP = realpath( '.' );
index caf7b69..ac5dbd7 100644 (file)
@@ -339,7 +339,7 @@ abstract class Installer {
 
                // Load the installer's i18n file.
                $wgExtensionMessagesFiles['MediawikiInstaller'] =
-                       dirname( __FILE__ ) . '/Installer.i18n.php';
+                       __DIR__ . '/Installer.i18n.php';
 
                // Having a user with id = 0 safeguards us from DB access via User::loadOptions().
                $wgUser = User::newFromId( 0 );
@@ -935,7 +935,7 @@ abstract class Installer {
         */
        protected function envCheckPath() {
                global $IP;
-               $IP = dirname( dirname( dirname( __FILE__ ) ) );
+               $IP = dirname( dirname( __DIR__ ) );
                $this->setVar( 'IP', $IP );
 
                $this->showMessage( 'config-using-uri', $this->getVar( 'wgServer' ), $this->getVar( 'wgScriptPath' ) );
index e1c5c29..0d5ea57 100644 (file)
@@ -362,7 +362,7 @@ class WebInstaller extends Installer {
                        $url = $m[1];
                }
                return md5( serialize( array(
-                       'local path' => dirname( dirname( __FILE__ ) ),
+                       'local path' => dirname( __DIR__ ),
                        'url' => $url,
                        'version' => $GLOBALS['wgVersion']
                ) ) );
index 9a516a6..e440c6b 100644 (file)
@@ -108,7 +108,7 @@ class WebInstallerOutput {
         * @return String
         */
        public function getCSS( $dir ) {
-               $skinDir = dirname( dirname( dirname( __FILE__ ) ) ) . '/skins';
+               $skinDir = dirname( dirname( __DIR__ ) ) . '/skins';
 
                // All these files will be concatenated in sequence and loaded
                // as one file.
index a7ec2df..a193afb 100644 (file)
@@ -1269,7 +1269,7 @@ abstract class WebInstaller_Document extends WebInstallerPage {
        }
 
        public function getFileContents() {
-               $file = dirname( __FILE__ ) . '/../../' . $this->getFileName();
+               $file = __DIR__ . '/../../' . $this->getFileName();
                if( ! file_exists( $file ) ) {
                        return wfMessage( 'config-nofile', $file )->plain();
                }
index aa60fbd..f67700c 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  */
 
-require_once dirname( __FILE__ ) . '/Services_JSON.php';
+require_once __DIR__ . '/Services_JSON.php';
 
 /**
  * JSON formatter wrapper class
index 2010878..2ee17f8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -51,7 +51,7 @@ if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'phase3/includes/WebStart.php' );
 } else {
-       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require ( __DIR__ . '/includes/WebStart.php' );
 }
 
 $mediaWiki = new MediaWiki();
index 69a72eb..1edca80 100644 (file)
@@ -32,7 +32,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 
 # Read language names
 global $wgLanguageNames;
-require_once( dirname( __FILE__ ) . '/Names.php' );
+require_once( __DIR__ . '/Names.php' );
 
 if ( function_exists( 'mb_strtoupper' ) ) {
        mb_internal_encoding( 'UTF-8' );
index 4fd41cf..14fe928 100644 (file)
@@ -21,8 +21,8 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageZh.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageZh.php' );
 
 /**
  * @ingroup Language
@@ -58,7 +58,7 @@ class GanConverter extends LanguageConverter {
        }
 
        function loadDefaultTables() {
-               require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" );
+               require( __DIR__ . "/../../includes/ZhConversion.php" );
                $this->mTables = array(
                        'gan-hans' => new ReplacementArray( $zh2Hans ),
                        'gan-hant' => new ReplacementArray( $zh2Hant ),
index 090d626..9bac5d7 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
 
 /**
  * Conversion script between Latin and Syllabics for Inuktitut.
index 7eb0b6c..5cf1afd 100644 (file)
@@ -21,8 +21,8 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageKk_cyrl.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageKk_cyrl.php' );
 
 define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
 define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
index 18c8564..02ec648 100644 (file)
@@ -21,8 +21,8 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageKu_ku.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageKu_ku.php' );
 
 /**
  * Kurdish converter routines
index ab34440..27c5d64 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
 
 /**
  * Conversion script between Latin and Tifinagh for Tachelhit.
index 26d6853..4b799f2 100644 (file)
@@ -21,9 +21,9 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageSr_ec.php' );
-require_once( dirname( __FILE__ ) . '/LanguageSr_el.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageSr_ec.php' );
+require_once( __DIR__ . '/LanguageSr_el.php' );
 
 /**
  * There are two levels of conversion for Serbian: the script level
index 90d5761..3ec1476 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
 
 /**
  * Converts Tajiki to latin orthography
index e0f45cd..bd69e30 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
 
 /**
  * @ingroup Language
index 96eea7c..63f90fd 100644 (file)
@@ -21,8 +21,8 @@
  * @ingroup Language
  */
 
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageZh_hans.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageZh_hans.php' );
 
 /**
  * @ingroup Language
@@ -64,7 +64,7 @@ class ZhConverter extends LanguageConverter {
        }
 
        function loadDefaultTables() {
-               require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" );
+               require( __DIR__ . "/../../includes/ZhConversion.php" );
                $this->mTables = array(
                        'zh-hans' => new ReplacementArray( $zh2Hans ),
                        'zh-hant' => new ReplacementArray( $zh2Hant ),
index 4c72080..6ffc145 100644 (file)
--- a/load.php
+++ b/load.php
@@ -31,7 +31,7 @@ if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'phase3/includes/WebStart.php' );
 } else {
-       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require ( __DIR__ . '/includes/WebStart.php' );
 }
 
 wfProfileIn( 'load.php' );
index cec1270..af549d7 100644 (file)
@@ -123,7 +123,7 @@ abstract class Maintenance {
                global $IP;
                $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
                        ? getenv( 'MW_INSTALL_PATH' )
-                       : realpath( dirname( __FILE__ ) . '/..' );
+                       : realpath( __DIR__ . '/..' );
 
                $this->addDefaultParams();
                register_shutdown_function( array( $this, 'outputChanneled' ), false );
@@ -988,7 +988,7 @@ abstract class Maintenance {
         * @return string
         */
        protected function getDir() {
-               return dirname( __FILE__ );
+               return __DIR__;
        }
 
        /**
@@ -1009,9 +1009,9 @@ abstract class Maintenance {
        protected static function getCoreScripts() {
                if ( !self::$mCoreScripts ) {
                        $paths = array(
-                               dirname( __FILE__ ),
-                               dirname( __FILE__ ) . '/language',
-                               dirname( __FILE__ ) . '/storage',
+                               __DIR__,
+                               __DIR__ . '/language',
+                               __DIR__ . '/storage',
                        );
                        self::$mCoreScripts = array();
                        foreach ( $paths as $p ) {
index 1765bd9..d406ea8 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup MaintenanceArchive
  */
 
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
+require( __DIR__ . '/../commandLine.inc' );
 
 class UpdateLogging {
 
index 78cae8c..475cafc 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to correct wrong values in the `page_latest` field
index 3ca3025..84aac57 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/backup.inc' );
+require_once( __DIR__ . '/backup.inc' );
 
 /**
  * @ingroup Maintenance
index 0056c3c..822f1a6 100644 (file)
@@ -27,7 +27,7 @@
  * @ingroup Benchmark
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 abstract class Benchmarker extends Maintenance {
        private $results;
 
index cf62aad..fb836c1 100644 (file)
@@ -22,7 +22,7 @@
  * @author  Platonides
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 class bench_HTTP_HTTPS extends Benchmarker {
 
        public function __construct() {
index 7138552..6e44864 100644 (file)
@@ -4,7 +4,7 @@
  * @ingroup Benchmark
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 
 class BenchmarkDeleteTruncate extends Benchmarker {
 
index dafce05..4a3abd4 100644 (file)
@@ -22,7 +22,7 @@
  * @author  Platonides
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 class bench_if_switch extends Benchmarker {
 
        public function __construct() {
index 73ace2b..cce7879 100644 (file)
@@ -4,7 +4,7 @@
  * @ingroup Benchmark
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 
 function bfNormalizeTitleStrTr( $str ) {
     return strtr( $str, '_', ' ' );
index 2e4b902..d71f5f5 100644 (file)
@@ -1,22 +1,22 @@
 <?php
-/**\r
- * @file\r
- * @ingroup Benchmark\r
- */\r
-\r
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );\r
+/**
+ * @file
+ * @ingroup Benchmark
+ */
+
+require_once( __DIR__ . '/Benchmarker.php' );
 
 /**
  * This little benchmark executes the regexp used in Language->checkTitleEncoding() and compares its execution time
  * against that of mb_check_encoding, if available.
- */\r
+ */
 class bench_utf8_title_check extends Benchmarker {
 
        private $canRun;
 
        private $data;
 
-       public function __construct() {\r
+       public function __construct() {
                parent::__construct();
 
                $this->data = array (
@@ -43,14 +43,14 @@ class bench_utf8_title_check extends Benchmarker {
 
                $this->canRun = function_exists ( 'mb_check_encoding' );
 
-               if ( $this->canRun ) {\r
+               if ( $this->canRun ) {
                        $this->mDescription = "Benchmark for using a regexp vs. mb_check_encoding to check for UTF-8 encoding.";
                        mb_internal_encoding( 'UTF-8' );
                } else {
                        $this->mDescription = "CANNOT RUN benchmark using mb_check_encoding: function not available.";
-               }\r
-       }\r
-\r
+               }
+       }
+
        public function execute() {
                if ( !$this->canRun ) {
                        return;
@@ -69,22 +69,22 @@ class bench_utf8_title_check extends Benchmarker {
                                'function' => array( $this, 'use_regexp_once_only' ),
                                'args' => array( rawurldecode ( $val ) )
                        );
-                       $benchmarks[] = array(\r
-                               'function' => array( $this, 'use_mb_check_encoding' ),\r
-                               'args' => array( rawurldecode ( $val ) )\r
+                       $benchmarks[] = array(
+                               'function' => array( $this, 'use_mb_check_encoding' ),
+                               'args' => array( rawurldecode ( $val ) )
                        );
-               }\r
+               }
                $this->bench( $benchmarks );
-               print $this->getFormattedResults();\r
-       }\r
+               print $this->getFormattedResults();
+       }
 
        private $isutf8;
-\r
+
        function use_regexp( $s ) {
                $this->isutf8 = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
-                               '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );\r
-       }\r
-\r
+                               '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
+       }
+
        function use_regexp_non_capturing( $s ) {
                // Same as above with a non-capturing subgroup.
                $this->isutf8 = preg_match( '/^(?:[\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
@@ -97,11 +97,11 @@ class bench_utf8_title_check extends Benchmarker {
                                '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
        }
 
-       function use_mb_check_encoding( $s ) {\r
-               $this->isutf8 = mb_check_encoding( $s, 'UTF-8' );\r
-       }\r
-\r
-}\r
-\r
-$maintClass = 'bench_utf8_title_check';\r
-require_once( RUN_MAINTENANCE_IF_MAIN );\r
+       function use_mb_check_encoding( $s ) {
+               $this->isutf8 = mb_check_encoding( $s, 'UTF-8' );
+       }
+
+}
+
+$maintClass = 'bench_utf8_title_check';
+require_once( RUN_MAINTENANCE_IF_MAIN );
index 4caebc5..cd07fbd 100644 (file)
@@ -22,7 +22,7 @@
  * @author  Platonides
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 class bench_wfIsWindows extends Benchmarker {
 
        public function __construct() {
index 4ec2616..508ea80 100644 (file)
@@ -19,7 +19,7 @@
  * @ingroup Benchmark
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 
 class BenchmarkHooks extends Benchmarker {
 
index e9d2ec7..4d36d26 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Benchmark
  */
 
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
 
 class BenchmarkPurge extends Benchmarker {
 
index 270f7a6..c06c2cd 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 /** */
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 
 function cdbShowHelp( $command ) {
        $commandList = array(
index e4063f9..f276fc1 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to change the password of a given user.
index ea6c09f..8d0e442 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to check classes definitions in the autoloader.
index f8b8955..670b93d 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to check that pages marked as being redirects really are.
index d7463ec..c05d915 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  * @ingroup Maintenance
  */
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to check images to see if they exist, are readable, etc.
index 3019b84..0a22f58 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to check syntax of all PHP files in MediaWiki.
index 6a9294a..dd5e002 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to check that database usernames are actually valid.
index d449d6c..dbc2e0d 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to cleans up old database tables, dropping old indexes
index b61f6ff..ec2aa95 100644 (file)
@@ -29,7 +29,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
 
 /**
  * Maintenance script to clean up broken page links when somebody turns on $wgCapitalLinks.
index 2beed72..4e7b937 100644 (file)
@@ -29,7 +29,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
 
 /**
  * Maintenance script to clean up broken, unparseable upload filenames.
index 706f87f..f37af77 100755 (executable)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance\r
  */\r
 \r
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );\r
+require_once( __DIR__ . '/Maintenance.php' );\r
 \r
 /**\r
  * Maintenance script that removes hidden preferences from the database.\r
index b339bfc..2085da9 100644 (file)
@@ -22,7 +22,7 @@
  * @author Roan Kattouw
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to remove cache entries for removed ResourceLoader modules
index 2051c89..e20bcd8 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to cleanup all spam from a given hostname.
index 898bdf4..85911ba 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Generic class to cleanup a database table. Already subclasses Maintenance.
index a2dc3a3..ad2577a 100644 (file)
@@ -29,7 +29,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
 
 /**
  * Maintenance script to clean up broken, unparseable titles.
index 32377b6..cc32946 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to remove old or broken uploads from temporary uploaded
index 840337c..fbab6a3 100644 (file)
@@ -29,7 +29,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
 
 /**
  * Maintenance script to remove broken, unparseable titles in the watchlist table.
index 638a475..88769df 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to clear the cache of interwiki prefixes for all local wikis.
index 2ed5a67..4581d53 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to remove all statistics tracking from the cache.
index c7adbfb..86a558d 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 global $optionsWithArgs;
 if ( !isset( $optionsWithArgs ) ) {
index 9d7f5c7..a333717 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/dumpIterator.php' );
+require_once( __DIR__ . '/dumpIterator.php' );
 
 /**
  * Maintenance script to take page text out of an XML dump file and render
index 275d8fa..5f7b02e 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to convert from the old links schema (string->ID)
index e666b65..7c9ca26 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to convert user options to the new `user_properties` table.
index 2363d40..aebdee1 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Copy all files in one container of one backend to another.
index 3f328f9..ad5333f 100644 (file)
@@ -22,7 +22,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to create an account and grant it administrator rights.
index 8709ee8..85ffc23 100644 (file)
@@ -24,8 +24,8 @@
  * @author Aaron Schulz
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/deleteArchivedFiles.inc' );
+require_once( __DIR__ . '/Maintenance.php' );
+require_once( __DIR__ . '/deleteArchivedFiles.inc' );
 
 /**
  * Maintenance script to delete archived (non-current) files from the database.
index 353661a..4b658bb 100644 (file)
@@ -24,8 +24,8 @@
  * @author Aaron Schulz
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/deleteArchivedRevisions.inc' );
+require_once( __DIR__ . '/Maintenance.php' );
+require_once( __DIR__ . '/deleteArchivedRevisions.inc' );
 
 /**
  * Maintenance script to delete archived (deleted from public) revisions
index 6860a5a..936a52b 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to delete a batch of pages.
index 540d225..4ab6d1d 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that deletes all pages in the MediaWiki namespace
index 2029b57..3c8c5fd 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that deletes image information from the object cache.
index 45a6b34..6a3e211 100644 (file)
@@ -22,7 +22,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that deletes old (non-current) revisions from the database.
index 13b9c91..5dc7567 100644 (file)
@@ -24,7 +24,7 @@
  * @todo More efficient cleanup of text records
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that deletes revisions which refer to a nonexisting page.
index fe3b515..ad6470d 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that deletes one or more revisions by moving them
index 162dcb4..da220d6 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that deletes self-references to $wgServer
index 4638468..c9546c6 100644 (file)
@@ -29,8 +29,8 @@ $originalDir = getcwd();
 
 $optionsWithArgs = array( 'pagelist', 'start', 'end', 'revstart', 'revend');
 
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
-require_once( dirname( __FILE__ ) . '/backup.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
+require_once( __DIR__ . '/backup.inc' );
 
 $dumper = new BackupDumper( $argv );
 
index 4c04d86..485218c 100644 (file)
@@ -26,7 +26,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Base class for interating over a dump.
index ad440e7..153fdd7 100644 (file)
@@ -30,7 +30,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that generates a plaintext link dump.
index 5dbb5e2..e05e154 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that generates a page name dump for SisterSites usage.
index 41a7a68..72d7d97 100644 (file)
@@ -26,8 +26,8 @@
 
 $originalDir = getcwd();
 
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
-require_once( dirname( __FILE__ ) . '/backupTextPass.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
+require_once( __DIR__ . '/backupTextPass.inc' );
 
 
 $dumper = new TextPassDumper( $argv );
index b16b0c2..0d0dfcf 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to dump a the list of files uploaded,
index 13b3c49..59df5e8 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to make a page edit.
index 3bd164f..5aefe1c 100644 (file)
@@ -34,7 +34,7 @@
 $optionsWithArgs = array( 'd' );
 
 /** */
-require_once( dirname( __FILE__ ) . "/commandLine.inc" );
+require_once( __DIR__ . "/commandLine.inc" );
 
 if ( isset( $options['d'] ) ) {
        $d = $options['d'];
index 2833081..a705bcc 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script used to fetch page text in a subprocess.
index 0f73e88..501bcfc 100644 (file)
@@ -25,7 +25,7 @@ $initialTime = microtime( true );
 $wgProfiler = array( 'class' => 'ProfilerSimpleText' );
 error_reporting( E_ALL );
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to test fileop performance.
index e4fa5de..e273c54 100644 (file)
@@ -34,7 +34,7 @@
  * @author Antoine Musso <hashar at free dot fr>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that compares documented and actually present mismatches.
index e52c6c3..6f017ec 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that fixes double redirects.
index d247862..2403ec6 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that fixes any entriy for protocol-relative URLs
index 126eed2..8bf556f 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that fixes erroneous page_latest values
index 3a95251..84d08d3 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that fixes timestamp corruption caused by one or
index 4eca396..91d42a5 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that fixes the user_registration field.
index 474caab..600ca97 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) .'/Maintenance.php' );
+require_once( __DIR__ .'/Maintenance.php' );
 
 /**
  * Maintenance script that formats RELEASE-NOTE file to wiki text or HTML markup.
index 8f3b8e5..1c96a57 100644 (file)
@@ -181,7 +181,7 @@ TODO:
 // ///////////////////////// COMMAND LINE HELP ////////////////////////////////////
 
 // This is a command line script, load MediaWiki env (gives command line options);
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 
 // if the user asked for an explanation of command line options.
 if ( isset( $options["help"] ) ) {
index a81e3d9..f3a5d87 100644 (file)
@@ -26,7 +26,7 @@
  * @see http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that generates a sitemap for the site.
index c47c61e..72b1d48 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that displays replication lag times.
index 0270052..ec9ed20 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that reports the hostname of a slave server.
index 34558b6..3e2f854 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that outputs page text to stdout.
index 2bb9951..2fa70dc 100755 (executable)
@@ -2,7 +2,7 @@
 <?php
 
 define( 'MW_CONFIG_CALLBACK', 'MakeHipHop::noConfigNeeded' );
-require( dirname( __FILE__ ) . '/../Maintenance.php' );
+require( __DIR__ . '/../Maintenance.php' );
 
 class MakeHipHop extends Maintenance {
        function noConfigNeeded() {}
@@ -12,7 +12,7 @@ class MakeHipHop extends Maintenance {
 
                $startTime = time();
 
-               $thisDir = realpath( dirname( __FILE__ ) );
+               $thisDir = realpath( __DIR__ );
                $IP = realpath( "$thisDir/../.." );
                if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
                        $buildDir = $wgHipHopBuildDirectory;
@@ -278,7 +278,7 @@ class MakeHipHop extends Maintenance {
                        }
                }
 
-               $extraCoreFiles = array_map( 'trim', file( dirname( __FILE__ ) . '/extra-files' ) );
+               $extraCoreFiles = array_map( 'trim', file( __DIR__ . '/extra-files' ) );
                foreach ( $extraCoreFiles as $file ) {
                        if ( $file === '' ) {
                                continue;
index 0ad4313..1c4b51f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/hphpi -f
 <?php
 
-require( dirname( __FILE__ ) . '/../Maintenance.php' );
+require( __DIR__ . '/../Maintenance.php' );
 
 class RunHipHopServer extends Maintenance {
        function __construct() {
@@ -19,7 +19,7 @@ class RunHipHopServer extends Maintenance {
 
        function runCompiled() {
                global $wgHipHopBuildDirectory;
-               $thisDir = realpath( dirname( __FILE__ ) );
+               $thisDir = realpath( __DIR__ );
                $IP = realpath( "$thisDir/../.." );
                if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
                        $buildDir = $wgHipHopBuildDirectory;
@@ -51,7 +51,7 @@ class RunHipHopServer extends Maintenance {
        }
 
        function runInterpreted() {
-               $thisDir = realpath( dirname( __FILE__ ) );
+               $thisDir = realpath( __DIR__ );
                $IP = realpath( "$thisDir/../.." );
                $sourceBase = realpath( "$IP/.." );
 
index b6e0fe0..b089f70 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that imports XML dump files into the current wiki.
index 76ec565..8d92383 100644 (file)
@@ -32,8 +32,8 @@
  */
 
 $optionsWithArgs = array( 'extensions', 'comment', 'comment-file', 'comment-ext', 'user', 'license', 'sleep', 'limit', 'from', 'source-wiki-url' );
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
-require_once( dirname( __FILE__ ) . '/importImages.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
+require_once( __DIR__ . '/importImages.inc' );
 $processed = $added = $ignored = $skipped = $overwritten = $failed = 0;
 
 echo( "Import Images\n\n" );
index b4a1bac..ae28567 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to import all scripts in the MediaWiki namespace from a
index 5623fb0..adb5063 100644 (file)
@@ -24,7 +24,7 @@
 
 $options = array( 'help', 'nooverwrite', 'norc' );
 $optionsWithArgs = array( 'title', 'user', 'comment' );
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 echo( "Import Text File\n\n" );
 
 if ( count( $args ) < 1 || isset( $options['help'] ) ) {
index 0f13645..3135b4c 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class InitEditCount extends Maintenance {
        public function __construct() {
index 35918bb..5d8b886 100644 (file)
@@ -23,7 +23,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to re-initialise or update the site statistics table
index 6339773..762bb94 100644 (file)
@@ -30,7 +30,7 @@ if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '
 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 define( 'MEDIAWIKI_INSTALL', true );
 
-require_once( dirname( dirname( __FILE__ ) )."/maintenance/Maintenance.php" );
+require_once( dirname( __DIR__ )."/maintenance/Maintenance.php" );
 
 /**
  * Maintenance script to install and configure MediaWiki
index c0a4dba..ceafc39 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to do test JavaScript validity parses using jsmin+'s parser
index 19c549a..3ad0864 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to show database lag.
index f872e6a..b537f9b 100644 (file)
@@ -20,7 +20,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class AllTrans extends Maintenance {
        public function __construct() {
index ea5b187..1888c4c 100644 (file)
@@ -21,8 +21,8 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
-$messagesDir = dirname( __FILE__ ) . '/../../languages/messages/';
+require_once( __DIR__ . '/../commandLine.inc' );
+$messagesDir = __DIR__ . '/../../languages/messages/';
 $runTest = false;
 $run = false;
 $runMode = 'text';
index a58a8f5..ebc62b6 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
 require_once( 'languages.inc' );
 require_once( 'checkLanguage.inc' );
 
index 69f6108..99ba4e9 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
 require_once( 'checkLanguage.inc' );
 require_once( 'languages.inc' );
 
index f949ddc..d37d22e 100644 (file)
@@ -20,7 +20,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class CountMessages extends Maintenance {
        public function __construct() {
index 04f5e8b..505cb57 100644 (file)
@@ -20,7 +20,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class DateFormats extends Maintenance {
 
index a80ac01..7e729b4 100644 (file)
@@ -18,7 +18,7 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class Digit2Html extends Maintenance {
 
index b7ca88d..9292ce3 100644 (file)
@@ -22,7 +22,7 @@
  * @todo Make this more useful, right now just dumps $wgContentLang
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class DumpMessages extends Maintenance {
        public function __construct() {
index 4cb90ff..c4a8e54 100644 (file)
@@ -21,7 +21,7 @@
  * @file
  */
 
-require_once( dirname( __FILE__ ) .'/../Maintenance.php' );
+require_once( __DIR__ .'/../Maintenance.php' );
 
 /**
  * Generate first letter data files for Collation.php
index 3dfda92..f3cc568 100644 (file)
@@ -21,9 +21,9 @@
  * @ingroup MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
-require_once( dirname( __FILE__ ) . '/../../includes/normal/UtfNormalUtil.php' );
+require_once( __DIR__ . '/../../includes/normal/UtfNormalUtil.php' );
 
 /**
  * Generates normalizer data files for Arabic and Malayalam.
index 28fe120..2323638 100644 (file)
@@ -22,8 +22,8 @@
  */
 
 /** This is a command line script */
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/languages.inc' );
+require_once( __DIR__ . '/../Maintenance.php' );
+require_once( __DIR__ . '/languages.inc' );
 
 class LangMemUsage extends Maintenance {
 
index ed2dae7..ad83905 100644 (file)
@@ -22,7 +22,7 @@
  * @defgroup MaintenanceLanguage MaintenanceLanguage
  */
 
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
 require_once( 'languages.inc' );
 require_once( 'writeMessagesArray.inc' );
 
index a298841..ba50322 100644 (file)
@@ -28,9 +28,9 @@
  */
 $optionsWithArgs = array( 'output' );
 
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
 require_once( 'languages.inc' );
-require_once( dirname( __FILE__ ) . '/StatOutputs.php' );
+require_once( __DIR__ . '/StatOutputs.php' );
 
 
 if ( isset( $options['help'] ) ) {
index 1e97c37..751e744 100644 (file)
@@ -30,7 +30,7 @@ array_shift( $argv );
 define( 'MEDIAWIKI', 1 );
 define( 'NOT_REALLY_MEDIAWIKI', 1 );
 
-$IP = dirname( __FILE__ ) . '/../..';
+$IP = __DIR__ . '/../..';
 
 require_once( "$IP/includes/Defines.php" );
 require_once( "$IP/languages/Language.php" );
index cd36847..b2e04c7 100644 (file)
@@ -105,7 +105,7 @@ $messages = array(
         */
        public static function writeMessagesArray( $messages, $ignoredComments = false, $prefix = false, $removeUnknown = false ) {
                # Load messages
-               $dir = $prefix ? $prefix : dirname( __FILE__ );
+               $dir = $prefix ? $prefix : __DIR__;
 
                require( $dir . '/messages.inc' );
                self::$messageStructure = $wgMessageStructure;
index 0244527..e07e62d 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 /** */
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 
 $mcc = new MWMemcached( array( 'persistent' => true/*, 'debug' => true*/ ) );
 $mcc->set_servers( $wgMemCachedServers );
index ed8250b..691b832 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that  makes several 'set', 'incr' and 'get' requests
index 8107016..cea6433 100644 (file)
@@ -25,7 +25,7 @@
 # Start from scratch
 define( 'MW_NO_EXTENSION_MESSAGES', 1 );
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 $maintClass = 'MergeMessageFileList';
 $mmfl = false;
 
@@ -104,7 +104,7 @@ $s =
 
 $dirs = array(
        $IP,
-       dirname( dirname( __FILE__ ) ),
+       dirname( __DIR__ ),
        realpath( $IP )
 );
 
index 451b598..497e1e0 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that re-assigns users from an old group to a new one.
index b17d8fe..9f5a909 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that minifies a file or set of files.
index 78db8b9..7d15959 100644 (file)
@@ -34,7 +34,7 @@
  * e.g. immobile_namespace for namespaces which can't be moved
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to move a batch of pages.
index a59ba17..583249a 100644 (file)
@@ -49,7 +49,7 @@ if ( php_sapi_name() != 'cli' ) {
 }
 
 /** Figure out the base directory for MediaWiki location */
-$mwPath = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;
+$mwPath = dirname( __DIR__ ) . DIRECTORY_SEPARATOR;
 
 /** doxygen binary script */
 $doxygenBin = 'doxygen';
index e2de686..4197a35 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that checks for articles to fix after
index bee4065..e66e981 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that picks a database that has pending jobs.
index 1defe1b..c471a44 100644 (file)
@@ -33,7 +33,7 @@
  * based on nukePage by Rob Church
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that removes pages with only one revision from the
index 3193d43..89dffe0 100644 (file)
@@ -23,7 +23,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that erases a page record from the database.
index aa20782..e222314 100644 (file)
@@ -26,7 +26,7 @@
  * i.e.: GRANT REFERENCES (user_id) ON mwuser TO hubclient;
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class AlterSharedConstraints extends Maintenance {
        public function __construct() {
index 1ab3b99..78f98f5 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that looks for 'orphan' revisions hooked to pages which
index 0271e1a..1f39355 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that manually runs an SQL patch outside of the general updaters.
index 037849b..ae54d69 100644 (file)
@@ -22,7 +22,7 @@
  * @author Simetrical
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Mainteance script to populate the category table.
index 0bbb5a2..37429a3 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to populate the img_sha1 field.
index 8a2366a..99d8155 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that makes the required database updates for populating the
index 3b4b2db..059b6fe 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that makes the required database updates for
index 6a1b5c8..e81d4ff 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that makes the required database updates for rev_parent_id
index 65dd91f..6c835f4 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that populates the rev_len field for old revisions
index bb620c5..2e14d31 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that fills the rev_sha1 and ar_sha1 columns of revision
index 5c2b0d4..5952fd9 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/dumpIterator.php' );
+require_once( __DIR__ . '/dumpIterator.php' );
 
 /**
  * Maintenance script that takes page text out of an XML dump file and
index 9dee67e..a53bc88 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 
 $wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'PPFuzzTester::templateHook';
 
index e60ee08..2f6aa1a 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that protects or unprotects a page.
index 7828049..e058e3e 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that prunes file cache for pages, objects, resources, etc.
index e9d149b..cd62716 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that scans the deletion log and purges affected files
index 049d6e3..4b3c382 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that sends purge requests for listed pages to squid.
index e68047c..1f0b063 100644 (file)
@@ -22,7 +22,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that purges old text records from the database.
index b56794b..1c41798 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require( dirname( __FILE__ ) . '/Maintenance.php' );
+require( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to remove old objects from the parser cache.
index ec7b081..225400f 100644 (file)
@@ -19,7 +19,7 @@
  * @ingroup Maintenance Memcached
  */
 
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 
 function purgeStaleMemcachedText() {
        global $wgMemc, $wgDBname;
index 2afd6e0..a91abf9 100644 (file)
@@ -23,7 +23,7 @@
  * @licence GNU General Public Licence 2.0 or later
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that reassigns edits from a user or IP address
index 4dbe267..3165b97 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that builds file cache for content pages.
index 936efd7..f5d06e4 100644 (file)
@@ -30,7 +30,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to update image metadata records.
index c48fb74..83849de 100644 (file)
@@ -29,7 +29,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to rebuild the localisation cache.
index bc9f732..882ae1b 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that rebuilds link tracking tables from scratch.
index a22d3af..a70e591 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that purges all languages from the message cache.
index 5caa0a8..0278f72 100644 (file)
@@ -23,7 +23,7 @@
  * @todo Document
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that rebuilds recent changes from scratch.
index a37d603..41b245f 100644 (file)
@@ -25,7 +25,7 @@
  * @todo document
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that rebuilds search index table from scratch.
index f9bdeea..be6bd18 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class RefreshImageCount extends Maintenance {
        public function __construct() {
index 6623bea..12da7a8 100644 (file)
@@ -27,7 +27,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to refresh image metadata fields.
index 699d885..3d9270b 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to refresh link tables.
index 490602d..8bc27c1 100644 (file)
@@ -23,7 +23,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that removes unused user accounts from the database.
index d8e53ee..6f24479 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that changes the prefix of database tables.
index c76a89b..b25fb94 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that takes page text out of an XML dump file
index ef8f5b0..d7f8c6d 100644 (file)
@@ -23,7 +23,7 @@
  * @author Daniel Friesen <mediawiki@danielfriesen.name>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to reset the user_token for all users on the wiki.
index c9f607e..4660bce 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to rollback all edits by a given user or IP provided
index 6322d31..e113916 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to run a database query in batches and wait for slaves.
index af7c906..e909bc0 100644 (file)
@@ -25,7 +25,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script that runs pending jobs.
index ff7d3fc..edcbdd6 100644 (file)
@@ -24,7 +24,7 @@
  * @author Antoine Musso
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class ShowJobs extends Maintenance {
        public function __construct() {
index b284a9a..f16853d 100644 (file)
@@ -28,7 +28,7 @@
  * @license GNU General Public License 2.0 or later
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class ShowStats extends Maintenance {
        public function __construct() {
index c4af630..7483dcc 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class MwSql extends Maintenance {
        public function __construct() {
index 864d5ab..7a22df5 100644 (file)
@@ -20,7 +20,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class SqliteMaintenance extends Maintenance {
        public function __construct() {
index 46926dd..cbea24b 100644 (file)
@@ -20,7 +20,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class CacheStats extends Maintenance {
 
index 29904db..6c669bf 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
-       require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+       require_once( __DIR__ . '/../commandLine.inc' );
 
        $cs = new CheckStorage;
        $fix = isset( $options['fix'] );
index 5064fe7..4594db7 100644 (file)
@@ -41,7 +41,7 @@
  * @ingroup Maintenance ExternalStorage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class CompressOld extends Maintenance {
        /**
index b200d8a..6020f22 100644 (file)
@@ -18,7 +18,7 @@
  * @ingroup Maintenance ExternalStorage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class DumpRev extends Maintenance {
        public function __construct() {
index cf30b0e..52ee825 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance ExternalStorage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class FixBug20757 extends Maintenance {
        var $batchSize = 10000;
index 64f3ada..2dcc25c 100644 (file)
@@ -24,8 +24,8 @@
 define( 'REPORTING_INTERVAL', 1 );
 
 if ( !defined( 'MEDIAWIKI' ) ) {
-       require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
-       require_once( dirname( __FILE__ ) . '/../../includes/ExternalStoreDB.php' );
+       require_once( __DIR__ . '/../commandLine.inc' );
+       require_once( __DIR__ . '/../../includes/ExternalStoreDB.php' );
        require_once( 'resolveStubs.php' );
 
        $fname = 'moveToExternal';
index f3b521f..82ee135 100644 (file)
@@ -20,7 +20,7 @@
  *
  * @ingroup Maintenance ExternalStorage
  */
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class OrphanStats extends Maintenance {
        public function __construct() {
index 158aa34..4098077 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 $optionsWithArgs = RecompressTracked::getOptionsWithArgs();
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
+require( __DIR__ . '/../commandLine.inc' );
 
 if ( count( $args ) < 1 ) {
        echo "Usage: php recompressTracked.php [options] <cluster> [... <cluster>...]
index 08d0ee0..7e288e1 100644 (file)
@@ -27,7 +27,7 @@ define( 'REPORTING_INTERVAL', 100 );
 if ( !defined( 'MEDIAWIKI' ) ) {
        $optionsWithArgs = array( 'm' );
 
-       require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+       require_once( __DIR__ . '/../commandLine.inc' );
 
        resolveStubs();
 }
index 817659f..1afecc4 100644 (file)
@@ -19,7 +19,7 @@
  * @ingroup Maintenance ExternalStorage
  */
 
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
 
 class StorageTypeStats extends Maintenance {
        function execute() {
index 9ae2633..998ebe4 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 $optionsWithArgs = array( 'start', 'limit', 'type' );
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
+require( __DIR__ . '/../commandLine.inc' );
 
 if ( !isset( $args[0] )  ) {
        echo "Usage: php testCompression.php [--type=<type>] [--start=<start-date>] [--limit=<num-revs>] <page-title>\n";
index b5f8004..214168a 100644 (file)
@@ -22,7 +22,7 @@
  * @see wfWaitForSlaves()
  */
 
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
+require( __DIR__ . '/../commandLine.inc' );
 
 
 if ( count( $args ) < 1 ) {
@@ -113,7 +113,7 @@ class TrackBlobs {
                        $dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_tracking' ) );
                        $dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_orphans' ) );
                }
-               $dbw->sourceFile( dirname( __FILE__ ) . '/blob_tracking.sql' );
+               $dbw->sourceFile( __DIR__ . '/blob_tracking.sql' );
        }
 
        function getTextClause() {
index 2dcf757..18d57c3 100644 (file)
@@ -20,7 +20,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class SyncFileBackend extends Maintenance {
        public function __construct() {
index 1c3b14a..ea8b0c4 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class Undelete extends Maintenance {
        public function __construct() {
index 741ec90..78e8827 100644 (file)
@@ -32,7 +32,7 @@ if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '
 }
 
 $wgUseMasterForMaintenance = true;
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateMediaWiki extends Maintenance {
 
index dbbfb80..730a1f6 100644 (file)
@@ -23,7 +23,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateArticleCount extends Maintenance {
 
index 2363665..ec99c99 100644 (file)
@@ -26,7 +26,7 @@
 
 #$optionsWithArgs = array( 'begin', 'max-slave-lag' );
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateCollation extends Maintenance {
        const BATCH_SIZE = 50; // Number of rows to process in one batch
index 61545f8..bcceab3 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateDoubleWidthSearch extends Maintenance {
 
index ffbdb2b..04e7f41 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateRestrictions extends Maintenance {
        public function __construct() {
index eed3571..59acc9a 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateSearchIndex extends Maintenance {
 
index a1a2e2f..c1e497d 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class UpdateSpecialPages extends Maintenance {
        public function __construct() {
index f0807b6..13faece 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 define( 'MW_UPGRADE_COPY',     false );
 define( 'MW_UPGRADE_ENCODE',   true  );
index 5e35747..2a06657 100644 (file)
@@ -25,7 +25,7 @@
 $options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' );
 $optionsWithArgs = array( 'old', 'new' );
 
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
 
 /**
  * @ingroup Maintenance
index 720ca28..468e239 100644 (file)
@@ -22,7 +22,7 @@
  * @see wfWaitForSlaves()
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 class WaitForSlave extends Maintenance {
        public function __construct() {
index 3f993f0..065d187 100644 (file)
@@ -8,11 +8,11 @@
 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 define( 'MEDIAWIKI_INSTALL', true );
 
-chdir( dirname( dirname( __FILE__ ) ) );
+chdir( dirname( __DIR__ ) );
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'core/includes/WebStart.php' );
 } else {
-       require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
+       require( dirname( __DIR__ ) . '/includes/WebStart.php' );
 }
 
 wfInstallerMain();
index ef038c1..bbd5fc8 100644 (file)
@@ -31,7 +31,7 @@ $wgEnableProfileInfo = $wgProfileToDatabase = false;
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'core/includes/WebStart.php' );
 } else {
-       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require ( __DIR__ . '/includes/WebStart.php' );
 }
 
 
index fde960e..5e6cfee 100644 (file)
@@ -24,7 +24,7 @@
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require ( 'phase3/includes/WebStart.php' );
 } else {
-       require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require ( __DIR__ . '/includes/WebStart.php' );
 }
 
 global $wgArticlePath;
index 9cadd75..28501ea 100644 (file)
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-$IP = dirname( dirname( __FILE__ ) );
+$IP = dirname( __DIR__ );
 
 define( 'SELENIUMTEST', true );
 
-//require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
-require( dirname( __FILE__ ) . '/../maintenance/Maintenance.php' );
+//require_once( __DIR__ . '/../maintenance/commandLine.inc' );
+require( __DIR__ . '/../maintenance/Maintenance.php' );
 
 require_once( 'PHPUnit/Runner/Version.php' );
 if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
@@ -43,7 +43,7 @@ if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
 require_once( 'PHPUnit/Extensions/SeleniumTestCase.php' );
 include_once( 'PHPUnit/Util/Log/JUnit.php' );
 
-require_once( dirname( __FILE__ ) . "/selenium/SeleniumServerManager.php" );
+require_once( __DIR__ . "/selenium/SeleniumServerManager.php" );
 
 class SeleniumTester extends Maintenance {
        protected $selenium;
index 3125284..e853b13 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 global $wgAutoloadClasses;
-$testFolder = dirname( __FILE__ );
+$testFolder = __DIR__;
 
 $wgAutoloadClasses += array(
 
index 9d75be4..4301587 100644 (file)
@@ -14,7 +14,7 @@
  *
  */ 
 
-$maintenanceDir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/maintenance';
+$maintenanceDir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/maintenance';
 
 require( "$maintenanceDir/Maintenance.php" );
 
index d930ac5..4df9a61 100644 (file)
@@ -27,7 +27,7 @@
 $otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled' );
 $optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' );
 
-require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
+require_once( __DIR__ . '/../maintenance/commandLine.inc' );
 
 if ( isset( $options['help'] ) ) {
        echo <<<ENDS
index ea385ad..fca3251 100644 (file)
@@ -37,7 +37,7 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
                # PHPUnit uses stream_resolve_include_path() internally
                # See bug 32022
                set_include_path(
-                       dirname( __FILE__ )
+                       __DIR__
                        .PATH_SEPARATOR
                        . get_include_path()
                );
index 08eb50f..933767e 100644 (file)
@@ -11,7 +11,7 @@ if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
 You are running these tests directly from phpunit. You may not have all globals correctly set.
 Running phpunit.php instead is recommended.
 EOF;
-       require_once ( dirname( __FILE__ ) . "/phpunit.php" );
+       require_once ( __DIR__ . "/phpunit.php" );
 }
 
 // Output a notice when running with older versions of PHPUnit
index 416ec86..39ce6e3 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * @group Database
  */
-require dirname( __FILE__ ) . "/../../../maintenance/runJobs.php";
+require __DIR__ . "/../../../maintenance/runJobs.php";
 
 class TemplateCategoriesTest extends MediaWikiLangTestCase {
 
index f7ca59e..d90a695 100644 (file)
@@ -4,7 +4,7 @@ class ZipDirectoryReaderTest extends MediaWikiTestCase {
        var $zipDir, $entries;
 
        function setUp() {
-               $this->zipDir = dirname( __FILE__ ) . '/../data/zip';
+               $this->zipDir = __DIR__ . '/../data/zip';
        }
 
        function zipCallback( $entry ) {
index 86c0a82..8b6a384 100644 (file)
@@ -79,7 +79,7 @@ class RandomImageGenerator {
                        foreach ( array(
                                        '/usr/share/dict/words',
                                        '/usr/dict/words',
-                                       dirname( __FILE__ ) . '/words.txt' )
+                                       __DIR__ . '/words.txt' )
                                        as $dictionaryFile ) {
                                if ( is_file( $dictionaryFile ) and is_readable( $dictionaryFile ) ) {
                                        $this->dictionaryFile = $dictionaryFile;
index b22eccd..ee34562 100644 (file)
@@ -6,11 +6,11 @@
  */
 
 // Evaluate the include path relative to this file
-$IP = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
+$IP = dirname( dirname( dirname( dirname( __DIR__ ) ) ) );
 
 // Start up MediaWiki in command-line mode
 require_once( "$IP/maintenance/Maintenance.php" );
-require(  dirname( __FILE__ ) . "/RandomImageGenerator.php" );
+require(  __DIR__ . "/RandomImageGenerator.php" );
 
 class GenerateRandomImages extends Maintenance {
 
index fe5867a..afd1cb8 100644 (file)
@@ -38,7 +38,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
-require_once dirname( __FILE__ ) . "/ORMRowTest.php";
+require_once __DIR__ . "/ORMRowTest.php";
 
 class TestORMRowTest extends ORMRowTest {
 
index f4f52dd..d6e2547 100644 (file)
@@ -2,7 +2,7 @@
 class BitmapMetadataHandlerTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->filePath = __DIR__ . '/../../data/media/';
        }
 
        /**
index 1e2d1bb..6af52dd 100644 (file)
@@ -8,7 +8,7 @@ class ExifRotationTest extends MediaWikiTestCase {
        function setUp() {
                parent::setUp();
                $this->handler = new BitmapHandler();
-               $filePath = dirname( __FILE__ ) . '/../../data/media';
+               $filePath = __DIR__ . '/../../data/media';
 
                $tmpDir = $this->getNewTempDirectory();
 
index fff8c0b..045777d 100644 (file)
@@ -2,7 +2,7 @@
 class ExifTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->mediaPath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->mediaPath = __DIR__ . '/../../data/media/';
 
                if ( !wfDl( 'exif' ) ) {
                        $this->markTestSkipped( "This test needs the exif extension." );
index 8a632f5..6ade670 100644 (file)
@@ -4,7 +4,7 @@ class FormatMetadataTest extends MediaWikiTestCase {
                if ( !wfDl( 'exif' ) ) {
                        $this->markTestSkipped( "This test needs the exif extension." );
                }
-               $filePath = dirname( __FILE__ ) .  '/../../data/media';
+               $filePath = __DIR__ .  '/../../data/media';
                $this->backend = new FSFileBackend( array(
                        'name'           => 'localtesting',
                        'lockManager'    => 'nullLockManager',
index 47fc368..650fdd5 100644 (file)
@@ -2,7 +2,7 @@
 class GIFMetadataExtractorTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->mediaPath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->mediaPath = __DIR__ . '/../../data/media/';
        }
        /**
         * Put in a file, and see if the metadata coming out is as expected.
index 3665835..5dcbeee 100644 (file)
@@ -2,7 +2,7 @@
 class GIFHandlerTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->filePath = dirname( __FILE__ ) .  '/../../data/media';
+               $this->filePath = __DIR__ .  '/../../data/media';
                $this->backend = new FSFileBackend( array(
                        'name'           => 'localtesting',
                        'lockManager'    => 'nullLockManager',
index f48382a..41d8119 100644 (file)
@@ -9,7 +9,7 @@
 class JpegMetadataExtractorTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->filePath = __DIR__ . '/../../data/media/';
        }
 
        /**
index ddabf5b..ea007f9 100644 (file)
@@ -2,7 +2,7 @@
 class JpegTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->filePath = __DIR__ . '/../../data/media/';
                if ( !wfDl( 'exif' ) ) {
                        $this->markTestSkipped( "This test needs the exif extension." );
                }
index 9f702c5..1b1b2ec 100644 (file)
@@ -2,7 +2,7 @@
 class PNGMetadataExtractorTest extends MediaWikiTestCase {
 
        function setUp() {
-               $this->filePath = dirname( __FILE__ ) . '/../../data/media/';   
+               $this->filePath = __DIR__ . '/../../data/media/';
        }
        /**
         * Tests zTXt tag (compressed textual metadata) 
index b6f911f..fe73c9c 100644 (file)
@@ -2,7 +2,7 @@
 class PNGHandlerTest extends MediaWikiTestCase {
 
        public function setUp() {
-               $this->filePath = dirname( __FILE__ ) .  '/../../data/media';
+               $this->filePath = __DIR__ .  '/../../data/media';
                $this->backend = new FSFileBackend( array(
                        'name'           => 'localtesting',
                        'lockManager'    => 'nullLockManager',
index 3017dbb..2116554 100644 (file)
@@ -39,7 +39,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
        }
 
        function providerSvgFiles() {
-               $base = dirname( __FILE__ ) . '/../../data/media';
+               $base = __DIR__ . '/../../data/media';
                return array(
                        array(
                                "$base/Wikimedia-logo.svg",
@@ -82,7 +82,7 @@ class SVGMetadataExtractorTest extends MediaWikiTestCase {
        }
 
        function providerSvgFilesWithXMLMetadata() {
-               $base = dirname( __FILE__ ) . '/../../data/media';
+               $base = __DIR__ . '/../../data/media';
                $metadata = 
     '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
       <ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about="">
index d4cf503..4c79f66 100644 (file)
@@ -5,7 +5,7 @@ class TiffTest extends MediaWikiTestCase {
                global $wgShowEXIF;
                $this->showExif = $wgShowEXIF;
                $wgShowEXIF = true;
-               $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+               $this->filePath = __DIR__ . '/../../data/media/';
                $this->handler = new TiffHandler;
        }
 
index 942cc3a..8198d3b 100644 (file)
@@ -26,7 +26,7 @@ class XMPTest extends MediaWikiTestCase {
        }
 
        public function dataXMPParse() {
-               $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/' ;
+               $xmpPath = __DIR__ . '/../../data/xmp/' ;
                $data = array();
 
                // $xmpFiles format: array of arrays with first arg file base name,
@@ -73,7 +73,7 @@ class XMPTest extends MediaWikiTestCase {
         * world example file to double check the support for this is right.
         */
        function testExtendedXMP() {
-               $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../data/xmp/';
                $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
                $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -103,7 +103,7 @@ class XMPTest extends MediaWikiTestCase {
         * and thus should only return the StandardXMP, not the ExtendedXMP.
         */
        function testExtendedXMPWithWrongGUID() {
-               $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../data/xmp/';
                $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
                $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
@@ -131,7 +131,7 @@ class XMPTest extends MediaWikiTestCase {
         * which should cause it to ignore the ExtendedXMP packet.
         */
        function testExtendedXMPMissingPacket() {
-               $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/';
+               $xmpPath = __DIR__ . '/../../data/xmp/';
                $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
                $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
 
index 816c017..6a6fded 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-require_once( dirname( __FILE__ ) . '/NewParserTest.php' );
+require_once( __DIR__ . '/NewParserTest.php' );
 
 /**
  * The UnitTest must be either a class that inherits from MediaWikiTestCase
index 9d3499a..fee5674 100644 (file)
@@ -103,7 +103,7 @@ class PreprocessorTest extends MediaWikiTestCase {
                        array( "{{foo|bar=|}", "<root>{{foo|bar=|}</root>"),
                        array( "{{Foo|} Bar=", "<root>{{Foo|} Bar=</root>"),
                        array( "{{Foo|} Bar=}}", "<root><template><title>Foo</title><part><name>} Bar</name>=<value></value></part></template></root>"),
-                       /* array( file_get_contents( dirname( __FILE__ ) . '/QuoteQuran.txt' ), file_get_contents( dirname( __FILE__ ) . '/QuoteQuranExpanded.txt' ) ), */
+                       /* array( file_get_contents( __DIR__ . '/QuoteQuran.txt' ), file_get_contents( __DIR__ . '/QuoteQuranExpanded.txt' ) ), */
                );
        }
 
@@ -165,7 +165,7 @@ class PreprocessorTest extends MediaWikiTestCase {
         * @dataProvider provideFiles
         */
        function testPreprocessorOutputFiles( $filename ) {
-               $folder = dirname( __FILE__ ) . "/../../../parser/preprocess";
+               $folder = __DIR__ . "/../../../parser/preprocess";
                $wikiText = file_get_contents( "$folder/$filename.txt" );
                $output = $this->preprocessToXml( $wikiText );
 
index c9dbb13..dc1c2ac 100644 (file)
@@ -12,7 +12,7 @@ class UploadStashTest extends MediaWikiTestCase {
                parent::setUp();
 
                // Setup a file for bug 29408
-               $this->bug29408File = dirname( __FILE__ ) . '/bug29408';
+               $this->bug29408File = __DIR__ . '/bug29408';
                file_put_contents( $this->bug29408File, "\x00" );
 
                self::$users = array(
index e7d3ea1..d44ecf8 100644 (file)
@@ -12,7 +12,7 @@
  * @file
  */
 
-require_once dirname( dirname( __FILE__ ) ) . '/bootstrap.php';
+require_once dirname( __DIR__ ) . '/bootstrap.php';
 
 /** Tests for MediaWiki languages/LanguageSr.php */
 class LanguageSrTest extends MediaWikiTestCase {
index 86f483d..7238728 100644 (file)
@@ -12,7 +12,7 @@
  * @file
  */
 
-require_once dirname( dirname( __FILE__ ) ) . '/bootstrap.php';
+require_once dirname( __DIR__ ) . '/bootstrap.php';
 
 /** Tests for MediaWiki languages/LanguageUz.php */
 class LanguageUzTest extends MediaWikiTestCase {
index 965d7be..8ff8557 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once dirname( __FILE__ ) . "/../../../maintenance/backupPrefetch.inc";
+require_once __DIR__ . "/../../../maintenance/backupPrefetch.inc";
 
 /**
  * Tests for BaseDump
index 24186fb..f669b26 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once dirname( __FILE__ ) . "/../../../maintenance/backupTextPass.inc";
+require_once __DIR__ . "/../../../maintenance/backupTextPass.inc";
 
 /**
  * Tests for page dumps of BackupDumper
index f0689b6..e7ffa01 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once dirname( __FILE__ ) . "/../../../maintenance/fetchText.php";
+require_once __DIR__ . "/../../../maintenance/fetchText.php";
 
 /**
  * Mock for the input/output of FetchText
index 8635614..0b7c758 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once dirname( __FILE__ ) . "/../../../maintenance/getSlaveServer.php";
+require_once __DIR__ . "/../../../maintenance/getSlaveServer.php";
 
 /**
  * Tests for getSlaveServer
index e4a90d8..bcbf4ec 100755 (executable)
@@ -9,7 +9,7 @@
 /* Configuration */
 
 // Evaluate the include path relative to this file
-$IP = dirname( dirname( dirname( __FILE__ ) ) );
+$IP = dirname( dirname( __DIR__ ) );
 
 // Set a flag which can be used to detect when other scripts have been entered through this entry point or not
 define( 'MW_PHPUNIT_TEST', true );
index 6779ad4..f263811 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-require_once( dirname( dirname( __FILE__ ) ) . '/includes/upload/UploadFromUrlTest.php' );
+require_once( dirname( __DIR__ ) . '/includes/upload/UploadFromUrlTest.php' );
 
 class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        public $savedGlobals = array();
index f1b7945..8e2afe7 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
 
 /**
  * Test Case ID   : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index 2d623af..55ad461 100644 (file)
@@ -27,7 +27,7 @@
  *
  */
 
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
 
 /**
  * Test Case ID   : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index b112bc0..825ca42 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
 
 /**
  * Test Case ID   : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index 024fe5d..c2b3505 100644 (file)
@@ -33,7 +33,7 @@
  * Version        : MediaWiki 1.18alpha
 */
 
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
 
 class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction {
 
index 806fcfd..78205cf 100644 (file)
@@ -33,7 +33,7 @@
  * Version        : MediaWiki 1.18alpha
 */
 
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
 
 class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction {
 
index 99df8a2..9e60391 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationConfig.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationConfig.php' );
 require_once ( dirname(__FILE__) . '/MediaWikiInstallationMessage.php' );
 require_once ( dirname(__FILE__) . '/MediaWikiInstallationVariables.php');
 
index 386a50e..58ccc7c 100644 (file)
 require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/Framework/TestSuite.php';
 
-require_once ( dirname( __FILE__ ) . '/MediaWikiUserInterfaceTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiButtonsAvailabilityTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiHelpFieldHintTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiRightFrameworkLinksTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiRestartInstallationTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiErrorsConnectToDatabasePageTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiErrorsNamepageTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiMySQLDataBaseTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiMySQLiteDataBaseTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiUpgradeExistingDatabaseTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiDifferntDatabasePrefixTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiDifferentDatabaseAccountTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiOnAlreadyInstalledTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiUserInterfaceTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiButtonsAvailabilityTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiHelpFieldHintTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiRightFrameworkLinksTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiRestartInstallationTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiErrorsConnectToDatabasePageTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiErrorsNamepageTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiMySQLDataBaseTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiMySQLiteDataBaseTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiUpgradeExistingDatabaseTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiDifferntDatabasePrefixTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiDifferentDatabaseAccountTestCase.php' );
+require_once ( __DIR__ . '/MediaWikiOnAlreadyInstalledTestCase.php' );
 
 
 
index 5fc1a5a..6b8fc97 100644 (file)
@@ -43,7 +43,7 @@ class MediawikiCoreSmokeTestCase extends SeleniumTestCase {
                $this->login();
                $this->open( $this->getUrl() .
                        '/index.php?title=Special:Upload' );
-               $this->type( 'wpUploadFile', dirname( __FILE__ ) .
+               $this->type( 'wpUploadFile', __DIR__ .
                        "\\..\\data\\Wikipedia-logo-v2-de.png" );
                $this->check( 'wpIgnoreWarning' );
                $this->click( 'wpUpload' );
index 01d87e4..b8d2d48 100644 (file)
@@ -27,7 +27,7 @@
  *
  */
 
-require_once dirname( dirname( __FILE__ ) ) . '/SeleniumTestConstants.php';
+require_once dirname( __DIR__ ) . '/SeleniumTestConstants.php';
 
 class MyContributionsTestCase extends SeleniumTestCase {
 
index d1ee3e7..998fab9 100644 (file)
@@ -27,7 +27,7 @@
  *
  */
 
-require_once dirname( dirname( __FILE__ ) ) . '/SeleniumTestConstants.php';
+require_once dirname( __DIR__ ) . '/SeleniumTestConstants.php';
 
 class MyWatchListTestCase extends SeleniumTestCase {
 
index 5fc4446..d4c6165 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -25,7 +25,7 @@ define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
        require( 'core/includes/WebStart.php' );
 } else {
-       require( dirname( __FILE__ ) . '/includes/WebStart.php' );
+       require( __DIR__ . '/includes/WebStart.php' );
 }
 
 // Don't use fancy mime detection, just check the file extension for jpg/gif/png
index abc71dd..69bdddd 100644 (file)
@@ -26,4 +26,4 @@ define( 'THUMB_HANDLER', true );
 
 # Execute thumb.php, having set THUMB_HANDLER so that
 # it knows to extract params from a thumbnail file URL.
-require( dirname( __FILE__ ) . '/thumb.php' );
+require( __DIR__ . '/thumb.php' );