Merge "(bug 39680) Convert valign to CSS vertical-align"
authorKrinkle <ttijhof@wikimedia.org>
Tue, 28 Aug 2012 20:58:41 +0000 (20:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 28 Aug 2012 20:58:41 +0000 (20:58 +0000)
297 files changed:
RELEASE-NOTES-1.20
api.php
docs/magicword.txt
extensions/README
img_auth.php
includes/AutoLoader.php
includes/Category.php
includes/CryptRand.php
includes/DataUpdate.php
includes/DefaultSettings.php
includes/Defines.php
includes/GlobalFunctions.php
includes/Linker.php
includes/Message.php
includes/OutputPage.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/Uri.php [deleted file]
includes/WebStart.php
includes/db/Database.php
includes/db/DatabasePostgres.php
includes/debug/Debug.php
includes/installer/DatabaseUpdater.php
includes/installer/Installer.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerPage.php
includes/job/Job.php
includes/json/FormatJson.php
includes/normal/UtfNormal.php
includes/parser/CoreParserFunctions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialUndelete.php
includes/upload/UploadFromUrl.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
languages/messages/MessagesCkb.php
languages/messages/MessagesDiq.php
languages/messages/MessagesGd.php
languages/messages/MessagesIt.php
languages/messages/MessagesJa.php
languages/messages/MessagesMl.php
languages/messages/MessagesPa.php
languages/messages/MessagesPms.php
languages/messages/MessagesTe.php
languages/messages/MessagesTet.php
languages/messages/MessagesUr.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/languages.inc
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/parse.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
opensearch_desc.php
profileinfo.php
redirect.php
serialized/serialize.php
skins/Simple.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/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/MockOutputPage.php [deleted file]
tests/phpunit/includes/TemplateCategoriesTest.php
tests/phpunit/includes/UriTest.php [deleted file]
tests/phpunit/includes/ZipDirectoryReaderTest.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/api/generateRandomImages.php
tests/phpunit/includes/db/DatabaseSQLTest.php
tests/phpunit/includes/db/TestORMRowTest.php
tests/phpunit/includes/debug/MWDebugTest.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/MediaWikiButtonsAvailabilityTestCase.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/installer/MediaWikiMySQLDataBaseTestCase.php
tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php
tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php
tests/selenium/installer/MediaWikiRestartInstallationTestCase.php
tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php
tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php
tests/selenium/installer/MediaWikiUserInterfaceTestCase.php
tests/selenium/suites/MediawikiCoreSmokeTestCase.php
tests/selenium/suites/MyContributionsTestCase.php
tests/selenium/suites/MyWatchListTestCase.php
thumb.php
thumb_handler.php

index 92f050e..1791d4d 100644 (file)
@@ -260,6 +260,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 38904) prop=revisions&rvstart=... no longer blows up when continuing.
 * (bug 39032) ApiQuery generates help in constructor.
 * (bug 11142) Improve file extension blacklist error reporting in API upload
+* (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error
 
 === Languages updated in 1.20 ===
 
@@ -293,6 +294,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 22f4710..e810286 100644 (file)
@@ -21,10 +21,10 @@ Please note that under POSIX systems (Linux...), parent of a symbolic path
 refers to the link source, NOT to the target! You should check the env
 variable MW_INSTALL_PATH in case the extension is not in the default location.
 
-The following code snippet let you override the default path: 
+The following code snippet lets you override the default path: 
 
  $IP = getenv( 'MW_INSTALL_PATH' );
  if( $IP === false ) {
-       $IP = dirname( __FILE__ ) . '/../..';
+       $IP = __DIR__ . '/../..';
  }
  require_once( "$IP/maintenance/Maintenance.php" ); // a MediaWiki core file
index 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 b299796..9d78dbd 100644 (file)
@@ -252,7 +252,6 @@ $wgAutoloadLocalClasses = array(
        'UnlistedSpecialPage' => 'includes/SpecialPage.php',
        'UploadSourceAdapter' => 'includes/Import.php',
        'UppercaseCollation' => 'includes/Collation.php',
-       'Uri' => 'includes/Uri.php',
        'User' => 'includes/User.php',
        'UserArray' => 'includes/UserArray.php',
        'UserArrayFromResult' => 'includes/UserArray.php',
@@ -1008,6 +1007,7 @@ $wgAutoloadLocalClasses = array(
        'Language' => 'languages/Language.php',
        'LanguageConverter' => 'languages/LanguageConverter.php',
        'CLDRPluralRuleEvaluator' => 'languages/utils/CLDRPluralRuleEvaluator.php',
+       'CLDRPluralRuleError' => 'languages/utils/CLDRPluralRuleEvaluator.php',
 
        # maintenance
        'ConvertLinks' => 'maintenance/convertLinks.php',
index d9ca234..b7b12e8 100644 (file)
@@ -297,8 +297,8 @@ class Category {
                        'IGNORE'
                );
 
-               $cond1 = $dbw->conditional( 'page_namespace=' . NS_CATEGORY, 1, 'NULL' );
-               $cond2 = $dbw->conditional( 'page_namespace=' . NS_FILE, 1, 'NULL' );
+               $cond1 = $dbw->conditional( array( 'page_namespace' => NS_CATEGORY ), 1, 'NULL' );
+               $cond2 = $dbw->conditional( array( 'page_namespace' => NS_FILE ), 1, 'NULL' );
                $result = $dbw->selectRow(
                        array( 'categorylinks', 'page' ),
                        array( 'pages' => 'COUNT(*)',
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 793d335..377b64c 100644 (file)
@@ -84,8 +84,8 @@ abstract class DataUpdate implements DeferrableUpdate {
                $exception = null;
 
                /**
-                * @var $update StorageUpdate
-                * @var $trans StorageUpdate
+                * @var $update DataUpdate
+                * @var $trans DataUpdate
                 */
 
                try {
index 3ea35d5..045eb98 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
@@ -5212,7 +5212,7 @@ $wgExtensionFunctions = array();
  *
  * @par Example:
  * @code
- *    $wgExtensionMessagesFiles['ConfirmEdit'] = dirname(__FILE__).'/ConfirmEdit.i18n.php';
+ *    $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
  * @endcode
  */
 $wgExtensionMessagesFiles = array();
index 55d9a7a..be9f981 100644 (file)
@@ -205,7 +205,7 @@ define( 'LIST_SET_PREPARED', 8);  // List of (?, ?, ?) for DatabaseIbm_db2
 /**
  * Unicode and normalisation related
  */
-require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
+require_once __DIR__.'/normal/UtfNormalDefines.php';
 
 /**@{
  * Hook support constants
index 35c7bbb..4ff258d 100644 (file)
@@ -391,7 +391,7 @@ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) {
 
        $cgi = '';
        foreach ( $array1 as $key => $value ) {
-               if ( $value !== false ) {
+               if ( !is_null($value) && $value !== false ) {
                        if ( $cgi != '' ) {
                                $cgi .= '&';
                        }
@@ -412,11 +412,8 @@ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) {
                        } else {
                                if ( is_object( $value ) ) {
                                        $value = $value->__toString();
-                               } elseif( !is_null( $value ) ) {
-                                       $cgi .= urlencode( $key ) . '=' . urlencode( $value );
-                               } else {
-                                       $cgi .= urlencode( $key );
                                }
+                               $cgi .= urlencode( $key ) . '=' . urlencode( $value );
                        }
                }
        }
@@ -443,15 +440,14 @@ function wfCgiToArray( $query ) {
                        continue;
                }
                if ( strpos( $bit, '=' ) === false ) {
-                       // Pieces like &qwerty become 'qwerty' => null
-                       $key = urldecode( $bit );
-                       $value = null;
+                       // Pieces like &qwerty become 'qwerty' => '' (at least this is what php does)
+                       $key = $bit;
+                       $value = '';
                } else {
                        list( $key, $value ) = explode( '=', $bit );
-                       $key = urldecode( $key );
-                       $value = urldecode( $value );
                }
-
+               $key = urldecode( $key );
+               $value = urldecode( $value );
                if ( strpos( $key, '[' ) !== false ) {
                        $keys = array_reverse( explode( '[', $key ) );
                        $key = array_pop( $keys );
@@ -476,15 +472,23 @@ function wfCgiToArray( $query ) {
  * Append a query string to an existing URL, which may or may not already
  * have query string parameters already. If so, they will be combined.
  *
- * @deprecated in 1.20. Use Uri class.
  * @param $url String
  * @param $query Mixed: string or associative array
  * @return string
  */
 function wfAppendQuery( $url, $query ) {
-       $obj = new Uri( $url );
-       $obj->extendQuery( $query );
-       return $obj->toString();
+       if ( is_array( $query ) ) {
+               $query = wfArrayToCgi( $query );
+       }
+       if( $query != '' ) {
+               if( false === strpos( $url, '?' ) ) {
+                       $url .= '?';
+               } else {
+                       $url .= '&';
+               }
+               $url .= $query;
+       }
+       return $url;
 }
 
 /**
@@ -572,13 +576,49 @@ function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
  * @todo Need to integrate this into wfExpandUrl (bug 32168)
  *
  * @since 1.19
- * @deprecated
  * @param $urlParts Array URL parts, as output from wfParseUrl
  * @return string URL assembled from its component parts
  */
 function wfAssembleUrl( $urlParts ) {
-       $obj = new Uri( $urlParts );
-       return $obj->toString();
+       $result = '';
+
+       if ( isset( $urlParts['delimiter'] ) ) {
+               if ( isset( $urlParts['scheme'] ) ) {
+                       $result .= $urlParts['scheme'];
+               }
+
+               $result .= $urlParts['delimiter'];
+       }
+
+       if ( isset( $urlParts['host'] ) ) {
+               if ( isset( $urlParts['user'] ) ) {
+                       $result .= $urlParts['user'];
+                       if ( isset( $urlParts['pass'] ) ) {
+                               $result .= ':' . $urlParts['pass'];
+                       }
+                       $result .= '@';
+               }
+
+               $result .= $urlParts['host'];
+
+               if ( isset( $urlParts['port'] ) ) {
+                       $result .= ':' . $urlParts['port'];
+               }
+       }
+
+       if ( isset( $urlParts['path'] ) ) {
+               $result .= $urlParts['path'];
+       }
+
+       if ( isset( $urlParts['query'] ) ) {
+               $result .= '?' . $urlParts['query'];
+       }
+
+       if ( isset( $urlParts['fragment'] ) ) {
+               $result .= '#' . $urlParts['fragment'];
+       }
+
+       return $result;
 }
 
 /**
@@ -725,13 +765,58 @@ function wfUrlProtocolsWithoutProtRel() {
  * 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
  * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
  *
- * @deprecated
  * @param $url String: a URL to parse
  * @return Array: bits of the URL in an associative array, per PHP docs
  */
 function wfParseUrl( $url ) {
-       $obj = new Uri( $url );
-       return $obj->getComponents();
+       global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
+
+       // Protocol-relative URLs are handled really badly by parse_url(). It's so bad that the easiest
+       // way to handle them is to just prepend 'http:' and strip the protocol out later
+       $wasRelative = substr( $url, 0, 2 ) == '//';
+       if ( $wasRelative ) {
+               $url = "http:$url";
+       }
+       wfSuppressWarnings();
+       $bits = parse_url( $url );
+       wfRestoreWarnings();
+       // parse_url() returns an array without scheme for some invalid URLs, e.g.
+       // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
+       if ( !$bits || !isset( $bits['scheme'] ) ) {
+               return false;
+       }
+
+       // most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
+       if ( in_array( $bits['scheme'] . '://', $wgUrlProtocols ) ) {
+               $bits['delimiter'] = '://';
+       } elseif ( in_array( $bits['scheme'] . ':', $wgUrlProtocols ) ) {
+               $bits['delimiter'] = ':';
+               // parse_url detects for news: and mailto: the host part of an url as path
+               // We have to correct this wrong detection
+               if ( isset( $bits['path'] ) ) {
+                       $bits['host'] = $bits['path'];
+                       $bits['path'] = '';
+               }
+       } else {
+               return false;
+       }
+
+       /* Provide an empty host for eg. file:/// urls (see bug 28627) */
+       if ( !isset( $bits['host'] ) ) {
+               $bits['host'] = '';
+
+               /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
+               if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
+                       $bits['path'] = '/' . $bits['path'];
+               }
+       }
+
+       // If the URL was protocol-relative, fix scheme and delimiter
+       if ( $wasRelative ) {
+               $bits['scheme'] = '';
+               $bits['delimiter'] = '//';
+       }
+       return $bits;
 }
 
 /**
@@ -847,10 +932,7 @@ function wfMatchesDomainList( $url, $domains ) {
  * @param $logonly Bool: set true to avoid appearing in HTML when $wgDebugComments is set
  */
 function wfDebug( $text, $logonly = false ) {
-       global $wgOut, $wgDebugLogFile, $wgDebugComments, $wgProfileOnly, $wgDebugRawPage;
-       global $wgDebugLogPrefix, $wgShowDebug;
-
-       static $cache = array(); // Cache of unoutputted messages
+       global $wgDebugLogFile, $wgProfileOnly, $wgDebugRawPage, $wgDebugLogPrefix;
 
        if ( !$wgDebugRawPage && wfIsDebugRawPage() ) {
                return;
@@ -861,15 +943,10 @@ function wfDebug( $text, $logonly = false ) {
                $text = preg_replace( '/[^\n]/', $timer . '\0', $text, 1 );
        }
 
-       if ( ( $wgDebugComments || $wgShowDebug ) && !$logonly ) {
-               $cache[] = $text;
-
-               if ( isset( $wgOut ) && is_object( $wgOut ) ) {
-                       // add the message and any cached messages to the output
-                       array_map( array( $wgOut, 'debug' ), $cache );
-                       $cache = array();
-               }
+       if ( !$logonly ) {
+               MWDebug::debugMsg( $text );
        }
+
        if ( wfRunHooks( 'Debug', array( $text, null /* no log group */ ) ) ) {
                if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
                        # Strip unprintables; they can switch terminal modes when binary data
@@ -879,8 +956,6 @@ function wfDebug( $text, $logonly = false ) {
                        wfErrorLog( $text, $wgDebugLogFile );
                }
        }
-
-       MWDebug::debugMsg( $text );
 }
 
 /**
@@ -1007,35 +1082,7 @@ function wfLogDBError( $text ) {
  * @return null
  */
 function wfDeprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
-       static $functionsWarned = array();
-
-       MWDebug::deprecated( $function, $version, $component );
-
-       if ( !isset( $functionsWarned[$function] ) ) {
-               $functionsWarned[$function] = true;
-
-               if ( $version ) {
-                       global $wgDeprecationReleaseLimit;
-
-                       if ( $wgDeprecationReleaseLimit && $component === false ) {
-                               # Strip -* off the end of $version so that branches can use the
-                               # format #.##-branchname to avoid issues if the branch is merged into
-                               # a version of MediaWiki later than what it was branched from
-                               $comparableVersion = preg_replace( '/-.*$/', '', $version );
-
-                               # If the comparableVersion is larger than our release limit then
-                               # skip the warning message for the deprecation
-                               if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
-                                       return;
-                               }
-                       }
-
-                       $component = $component === false ? 'MediaWiki' : $component;
-                       wfWarn( "Use of $function was deprecated in $component $version.", $callerOffset );
-               } else {
-                       wfWarn( "Use of $function is deprecated.", $callerOffset );
-               }
-       }
+       MWDebug::deprecated( $function, $version, $component, $callerOffset + 1 );
 }
 
 /**
@@ -1049,34 +1096,7 @@ function wfDeprecated( $function, $version = false, $component = false, $callerO
  *        is true
  */
 function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
-       global $wgDevelopmentWarnings;
-
-       MWDebug::warning( $msg, $callerOffset + 2 );
-
-       $callers = wfDebugBacktrace();
-       if ( isset( $callers[$callerOffset + 1] ) ) {
-               $callerfunc = $callers[$callerOffset + 1];
-               $callerfile = $callers[$callerOffset];
-               if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
-                       $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
-               } else {
-                       $file = '(internal function)';
-               }
-               $func = '';
-               if ( isset( $callerfunc['class'] ) ) {
-                       $func .= $callerfunc['class'] . '::';
-               }
-               if ( isset( $callerfunc['function'] ) ) {
-                       $func .= $callerfunc['function'];
-               }
-               $msg .= " [Called from $func in $file]";
-       }
-
-       if ( $wgDevelopmentWarnings ) {
-               trigger_error( $msg, $level );
-       } else {
-               wfDebug( "$msg\n" );
-       }
+       MWDebug::warning( $msg, $callerOffset + 1, $level );
 }
 
 /**
@@ -2308,11 +2328,7 @@ function wfSuppressWarnings( $end = false ) {
                }
        } else {
                if ( !$suppressCount ) {
-                       // E_DEPRECATED is undefined in PHP 5.2
-                       if( !defined( 'E_DEPRECATED' ) ) {
-                               define( 'E_DEPRECATED', 8192 );
-                       }
-                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED ) );
+                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED ) );
                }
                ++$suppressCount;
        }
index 0b2deef..7aba444 100644 (file)
@@ -1863,7 +1863,6 @@ class Linker {
         * @return String: HTML output
         */
        public static function formatHiddenCategories( $hiddencats ) {
-               global $wgLang;
                wfProfileIn( __METHOD__ );
 
                $outText = '';
index f559d30..776a52f 100644 (file)
@@ -209,6 +209,7 @@ class Message {
 
        /**
         * Constructor.
+        * @since 1.17
         * @param $key: message key, or array of message keys to try and use the first non-empty message for
         * @param $params Array message parameters
         * @return Message: $this
@@ -224,6 +225,7 @@ class Message {
         * Factory function that is just wrapper for the real constructor. It is
         * intented to be used instead of the real constructor, because it allows
         * chaining method calls, while new objects don't.
+        * @since 1.17
         * @param $key String: message key
         * @param Varargs: parameters as Strings
         * @return Message: $this
@@ -238,6 +240,7 @@ class Message {
         * Factory function accepting multiple message keys and returning a message instance
         * for the first message which is non-empty. If all messages are empty then an
         * instance of the first message key is returned.
+        * @since 1.18
         * @param Varargs: message keys (or first arg as an array of all the message keys)
         * @return Message: $this
         */
@@ -257,6 +260,7 @@ class Message {
 
        /**
         * Adds parameters to the parameter list of this message.
+        * @since 1.17
         * @param Varargs: parameters as Strings, or a single argument that is an array of Strings
         * @return Message: $this
         */
@@ -275,6 +279,7 @@ class Message {
         * In other words the parsing process cannot access the contents
         * of this type of parameter, and you need to make sure it is
         * sanitized beforehand.  The parser will see "$n", instead.
+        * @since 1.17
         * @param Varargs: raw parameters as Strings (or single argument that is an array of raw parameters)
         * @return Message: $this
         */
@@ -292,6 +297,7 @@ class Message {
        /**
         * Add parameters that are numeric and will be passed through
         * Language::formatNum before substitution
+        * @since 1.18
         * @param Varargs: numeric parameters (or single argument that is array of numeric parameters)
         * @return Message: $this
         */
@@ -308,7 +314,7 @@ class Message {
 
        /**
         * Set the language and the title from a context object
-        *
+        * @since 1.19
         * @param $context IContextSource
         * @return Message: $this
         */
@@ -378,6 +384,7 @@ class Message {
 
        /**
         * Enable or disable database use.
+        * @since 1.17
         * @param $value Boolean
         * @return Message: $this
         */
@@ -388,7 +395,7 @@ class Message {
 
        /**
         * Set the Title object to use as context when transforming the message
-        *
+        * @since 1.18
         * @param $title Title object
         * @return Message: $this
         */
@@ -399,6 +406,7 @@ class Message {
 
        /**
         * Returns the message parsed from wikitext to HTML.
+        * @since 1.17
         * @return String: HTML
         */
        public function toString() {
@@ -441,6 +449,7 @@ class Message {
         * Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg:
         *     $foo = Message::get($key);
         *     $string = "<abbr>$foo</abbr>";
+        * @since 1.18
         * @return String
         */
        public function __toString() {
@@ -449,6 +458,7 @@ class Message {
 
        /**
         * Fully parse the text from wikitext to HTML
+        * @since 1.17
         * @return String parsed HTML
         */
        public function parse() {
@@ -458,6 +468,7 @@ class Message {
 
        /**
         * Returns the message text. {{-transformation is done.
+        * @since 1.17
         * @return String: Unescaped message text.
         */
        public function text() {
@@ -467,6 +478,7 @@ class Message {
 
        /**
         * Returns the message text as-is, only parameters are subsituted.
+        * @since 1.17
         * @return String: Unescaped untransformed message text.
         */
        public function plain() {
@@ -476,6 +488,7 @@ class Message {
 
        /**
         * Returns the parsed message text which is always surrounded by a block element.
+        * @since 1.17
         * @return String: HTML
         */
        public function parseAsBlock() {
@@ -486,6 +499,7 @@ class Message {
        /**
         * Returns the message text. {{-transformation is done and the result
         * is escaped excluding any raw parameters.
+        * @since 1.17
         * @return String: Escaped message text.
         */
        public function escaped() {
@@ -495,6 +509,7 @@ class Message {
 
        /**
         * Check whether a message key has been defined currently.
+        * @since 1.17
         * @return Bool: true if it is and false if not.
         */
        public function exists() {
@@ -503,6 +518,7 @@ class Message {
 
        /**
         * Check whether a message does not exist, or is an empty string
+        * @since 1.18
         * @return Bool: true if is is and false if not
         * @todo FIXME: Merge with isDisabled()?
         */
@@ -513,6 +529,7 @@ class Message {
 
        /**
         * Check whether a message does not exist, is an empty string, or is "-"
+        * @since 1.18
         * @return Bool: true if is is and false if not
         */
        public function isDisabled() {
@@ -521,6 +538,7 @@ class Message {
        }
 
        /**
+        * @since 1.17
         * @param $value
         * @return array
         */
@@ -529,6 +547,7 @@ class Message {
        }
 
        /**
+        * @since 1.18
         * @param $value
         * @return array
         */
@@ -538,6 +557,7 @@ class Message {
 
        /**
         * Substitutes any paramaters into the message text.
+        * @since 1.17
         * @param $message String: the message text
         * @param $type String: either before or after
         * @return String
@@ -556,6 +576,7 @@ class Message {
 
        /**
         * Extracts the parameter type and preprocessed the value if needed.
+        * @since 1.18
         * @param $param String|Array: Parameter as defined in this class.
         * @return Tuple(type, value)
         * @throws MWException
@@ -576,6 +597,7 @@ class Message {
 
        /**
         * Wrapper for what ever method we use to parse wikitext.
+        * @since 1.17
         * @param $string String: Wikitext message contents
         * @return string Wikitext parsed into HTML
         */
@@ -585,6 +607,7 @@ class Message {
 
        /**
         * Wrapper for what ever method we use to {{-transform wikitext.
+        * @since 1.17
         * @param $string String: Wikitext message contents
         * @return string Wikitext with {{-constructs replaced with their values.
         */
@@ -594,7 +617,7 @@ class Message {
 
        /**
         * Wrapper for what ever method we use to get message contents
-        *
+        * @since 1.17
         * @return string
         */
        protected function fetchMessage() {
index e9e2b6f..bc9eaa9 100644 (file)
@@ -56,9 +56,9 @@ class OutputPage extends ContextSource {
        /**
         * Holds the debug lines that will be output as comments in page source if
         * $wgDebugComments is enabled. See also $wgShowDebug.
-        * TODO: make a getter method for this
+        * @deprecated since 1.20; use MWDebug class instead.
         */
-       public $mDebugtext = ''; // TODO: we might want to replace it by wfDebug() wfDebugLog()
+       public $mDebugtext = '';
 
        /// Should be private. Stores contents of "<title>" tag
        var $mHTMLtitle = '';
@@ -1314,15 +1314,6 @@ class OutputPage extends ContextSource {
                return $this->mBodytext;
        }
 
-       /**
-        * Add $text to the debug output
-        *
-        * @param $text String: debug text
-        */
-       public function debug( $text ) {
-               $this->mDebugtext .= $text;
-       }
-
        /**
         * Get/set the ParserOptions object to use for wikitext parsing
         *
@@ -2032,10 +2023,6 @@ class OutputPage extends ContextSource {
         *                   based on $pageTitle
         */
        public function prepareErrorPage( $pageTitle, $htmlTitle = false ) {
-               if ( $this->getTitle() ) {
-                       $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
-               }
-
                $this->setPageTitle( $pageTitle );
                if ( $htmlTitle !== false ) {
                        $this->setHTMLTitle( $htmlTitle );
index 38f3895..364d8c5 100644 (file)
@@ -437,7 +437,7 @@ abstract class Skin extends ContextSource {
                if ( !empty( $allCats['normal'] ) ) {
                        $t = $embed . implode( "{$pop}{$embed}" , $allCats['normal'] ) . $pop;
 
-                       $msg = $this->msg( 'pagecategories', count( $allCats['normal'] ) )->escaped();
+                       $msg = $this->msg( 'pagecategories' )->numParams( count( $allCats['normal'] ) )->escaped();
                        $linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text();
                        $s .= '<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
                                Linker::link( Title::newFromText( $linkPage ), $msg )
@@ -455,7 +455,7 @@ abstract class Skin extends ContextSource {
                        }
 
                        $s .= "<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
-                               $this->msg( 'hidden-categories', count( $allCats['hidden'] ) )->escaped() .
+                               $this->msg( 'hidden-categories' )->numParams( count( $allCats['hidden'] ) )->escaped() .
                                $colon . '<ul>' . $embed . implode( "{$pop}{$embed}" , $allCats['hidden'] ) . $pop . '</ul>' .
                                '</div>';
                }
@@ -568,71 +568,7 @@ abstract class Skin extends ContextSource {
         * @return String HTML containing debug data, if enabled (otherwise empty).
         */
        protected function generateDebugHTML() {
-               global $wgShowDebug;
-
-               $html = MWDebug::getDebugHTML( $this->getContext() );
-
-               if ( $wgShowDebug ) {
-                       $listInternals = $this->formatDebugHTML( $this->getOutput()->mDebugtext );
-                       $html .= "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">" .
-                               $listInternals . "</ul>\n";
-               }
-
-               return $html;
-       }
-
-       /**
-        * @param $debugText string
-        * @return string
-        */
-       private function formatDebugHTML( $debugText ) {
-               global $wgDebugTimestamps;
-
-               $lines = explode( "\n", $debugText );
-               $curIdent = 0;
-               $ret = '<li>';
-
-               foreach ( $lines as $line ) {
-                       $pre = '';
-                       if ( $wgDebugTimestamps ) {
-                               $matches = array();
-                               if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
-                                       $pre = $matches[1];
-                                       $line = substr( $line, strlen( $pre ) );
-                               }
-                       }
-                       $display = ltrim( $line );
-                       $ident = strlen( $line ) - strlen( $display );
-                       $diff = $ident - $curIdent;
-
-                       $display = $pre . $display;
-                       if ( $display == '' ) {
-                               $display = "\xc2\xa0";
-                       }
-
-                       if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
-                               $ident = $curIdent;
-                               $diff = 0;
-                               $display = '<span style="background:yellow;">' . htmlspecialchars( $display ) . '</span>';
-                       } else {
-                               $display = htmlspecialchars( $display );
-                       }
-
-                       if ( $diff < 0 ) {
-                               $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
-                       } elseif ( $diff == 0 ) {
-                               $ret .= "</li><li>\n";
-                       } else {
-                               $ret .= str_repeat( "<ul><li>\n", $diff );
-                       }
-                       $ret .= "<tt>$display</tt>\n";
-
-                       $curIdent = $ident;
-               }
-
-               $ret .= str_repeat( '</li></ul>', $curIdent ) . '</li>';
-
-               return $ret;
+               return MWDebug::getHTMLDebugLog();
        }
 
        /**
index 2c869db..d3502e9 100644 (file)
@@ -135,7 +135,6 @@ class SkinTemplate extends Skin {
                global $wgDisableCounters, $wgSitename, $wgLogo, $wgHideInterlanguageLinks;
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
-               global $wgDebugComments;
                global $wgArticlePath, $wgScriptPath, $wgServer;
 
                wfProfileIn( __METHOD__ );
@@ -387,12 +386,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-               if ( $wgDebugComments ) {
-                       $tpl->setRef( 'debug', $out->mDebugtext );
-               } else {
-                       $tpl->set( 'debug', '' );
-               }
-
                $tpl->set( 'sitenotice', $this->getSiteNotice() );
                $tpl->set( 'bottomscripts', $this->bottomScripts() );
                $tpl->set( 'printfooter', $this->printSource() );
@@ -468,6 +461,7 @@ class SkinTemplate extends Skin {
                        $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
                }
 
+               $tpl->set( 'debug', '' );
                $tpl->set( 'debughtml', $this->generateDebugHTML() );
                $tpl->set( 'reporttime', wfReportTime() );
 
@@ -1886,13 +1880,7 @@ abstract class BaseTemplate extends QuickTemplate {
        function printTrail() { ?>
 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
 <?php $this->html( 'reporttime' ) ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
-
--->
-<?php endif;
+<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() );
        }
 
 }
-
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;
                }
diff --git a/includes/Uri.php b/includes/Uri.php
deleted file mode 100644 (file)
index deabbb2..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-<?php
-/**
- * Class for simple URI parsing and manipulation.
- * Intended to simplify things that were using wfParseUrl and
- * had to do manual concatenation for various needs.
- * Built to match our JS mw.Uri in naming patterns.
- * @file
- * @author Daniel Friesen
- * @since 1.20
- */
-
-class Uri {
-
-       /**
-        * The parsed components of the URI
-        */
-       protected $components;
-
-       protected static $validComponents = array( 'scheme', 'delimiter', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment' );
-       protected static $componentAliases = array( 'protocol' => 'scheme', 'password' => 'pass' );
-
-       /**
-        * parse_url() work-alike, but non-broken.  Differences:
-        *
-        * 1) Does not raise warnings on bad URLs (just returns false)
-        * 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
-        * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
-        *
-        * @param $url String: a URL to parse
-        * @return Array: bits of the URL in an associative array, per PHP docs
-        */
-       protected static function parseUri( $url ) {
-               global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
-
-               // Protocol-relative URLs are handled really badly by parse_url(). It's so bad that the easiest
-               // way to handle them is to just prepend 'http:' and strip the protocol out later
-               $wasRelative = substr( $url, 0, 2 ) == '//';
-               if ( $wasRelative ) {
-                       $url = "http:$url";
-               }
-               wfSuppressWarnings();
-               $bits = parse_url( $url );
-               wfRestoreWarnings();
-               // parse_url() returns an array without scheme for some invalid URLs, e.g.
-               // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
-               if ( !$bits ||
-                    !isset( $bits['scheme'] ) && strpos( $url, "://" ) !== false ) {
-                       wfDebug( __METHOD__ . ": Invalid URL: $url" );
-                       return false;
-               } else {
-                       $scheme = isset( $bits['scheme'] ) ? $bits['scheme'] : null;
-               }
-
-               // most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
-               if ( in_array( $scheme . '://', $wgUrlProtocols ) ) {
-                       $bits['delimiter'] = '://';
-               } elseif ( !is_null( $scheme ) && !in_array( $scheme . ':', $wgUrlProtocols ) ) {
-                       wfDebug( __METHOD__ . ": Invalid scheme in URL: $scheme" );
-                       return false;
-               } elseif( !is_null( $scheme ) ) {
-                       if( !in_array( $scheme . ':', $wgUrlProtocols ) ) {
-                               // For URLs that don't have a scheme, but do have a user:password, parse_url
-                               // detects the user as the scheme.
-                               unset( $bits['scheme'] );
-                               $bits['user'] = $scheme;
-                       } else {
-                               $bits['delimiter'] = ':';
-                               // parse_url detects for news: and mailto: the host part of an url as path
-                               // We have to correct this wrong detection
-                               if ( isset( $bits['path'] ) ) {
-                                       $bits['host'] = $bits['path'];
-                                       $bits['path'] = '';
-                               }
-                       }
-               }
-
-               /* Provide an empty host for eg. file:/// urls (see bug 28627) */
-               if ( !isset( $bits['host'] ) && $scheme == "file" ) {
-                       $bits['host'] = '';
-
-                       /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
-                       if ( isset( $bits['path'] ) && substr( $bits['path'], 0, 1 ) !== '/' ) {
-                               $bits['path'] = '/' . $bits['path'];
-                       }
-               }
-
-               // If the URL was protocol-relative, fix scheme and delimiter
-               if ( $wasRelative ) {
-                       $bits['scheme'] = '';
-                       $bits['delimiter'] = '//';
-               }
-               return $bits;
-       }
-
-       /**
-        *
-        * @param $uri mixed URI string or array
-        */
-       public function __construct( $uri ) {
-               $this->components = array();
-               $this->setUri( $uri );
-       }
-
-       /**
-        * Set the Uri to the value of some other URI.
-        *
-        * @param $uri mixed URI string or array
-        */
-       public function setUri( $uri ) {
-               if ( is_string( $uri ) ) {
-                       $parsed = self::parseUri( $uri );
-                       if( $parsed === false ) {
-                               return false;
-                       }
-                       $this->setComponents( $parsed );
-               } elseif ( is_array( $uri ) ) {
-                       $this->setComponents( $uri );
-               } elseif ( $uri instanceof Uri ) {
-                       $this->setComponents( $uri->getComponents() );
-               } else {
-                       throw new MWException( __METHOD__ . ": $uri is not of a valid type." );
-               }
-       }
-
-       /**
-        * Set the components of this array.
-        * Will output warnings when invalid components or aliases are found.
-        *
-        * @param $components Array The components to set on this Uri.
-        */
-       public function setComponents( array $components ) {
-               foreach ( $components as $name => $value ) {
-                       if ( isset( self::$componentAliases[$name] ) ) {
-                               $canonical = self::$componentAliases[$name];
-                               wfDebug( __METHOD__ . ": Converting alias $name to canonical $canonical." );
-                               $components[$canonical] = $value;
-                               unset( $components[$name] );
-                       } elseif ( !in_array( $name, self::$validComponents ) ) {
-                               throw new MWException( __METHOD__ . ": $name is not a valid component." );
-                       }
-               }
-
-               $this->components = $components;
-       }
-
-       /**
-        * Return the components for this Uri
-        * @return Array
-        */
-       public function getComponents() {
-               return $this->components;
-       }
-
-       /**
-        * Return the value of a specific component
-        *
-        * @param $name string The name of the component to return
-        * @param string|null
-        */
-       public function getComponent( $name ) {
-               if ( isset( self::$componentAliases[$name] ) ) {
-                       // Component is an alias. Get the actual name.
-                       $alias = $name;
-                       $name = self::$componentAliases[$name];
-                       wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
-               }
-
-               if( !in_array( $name, self::$validComponents ) ) {
-                       // Component is invalid
-                       throw new MWException( __METHOD__ . ": $name is not a valid component." );
-               } elseif( !empty( $this->components[$name] ) ) {
-                       // Component is valid and has a value.
-                       return $this->components[$name];
-               } else {
-                       // Component is empty
-                       return null;
-               }
-       }
-
-       /**
-        * Set a component for this Uri
-        * @param $name string The name of the component to set
-        * @param $value string|null The value to set
-        */
-       public function setComponent( $name, $value ) {
-               if ( isset( self::$componentAliases[$name] ) ) {
-                       $alias = $name;
-                       $name = self::$componentAliases[$name];
-                       wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
-               } elseif ( !in_array( $name, self::$validComponents ) ) {
-                       throw new MWException( __METHOD__ . ": $name is not a valid component." );
-               }
-               $this->components[$name] = $value;
-       }
-
-       public function getProtocol() { return $this->getComponent( 'scheme' ); }
-       public function getUser() { return $this->getComponent( 'user' ); }
-       public function getPassword() { return $this->getComponent( 'pass' ); }
-       public function getHost() { return $this->getComponent( 'host' ); }
-       public function getPort() { return $this->getComponent( 'port' ); }
-       public function getPath() { return $this->getComponent( 'path' ); }
-       public function getQueryString() { return $this->getComponent( 'query' ); }
-       public function getFragment() { return $this->getComponent( 'fragment' ); }
-
-       public function setProtocol( $scheme ) { $this->setComponent( 'scheme', $scheme ); }
-       public function setUser( $user ) { $this->setComponent( 'user', $user ); }
-       public function setPassword( $pass ) { $this->setComponent( 'pass', $pass ); }
-       public function setHost( $host ) { $this->setComponent( 'host', $host ); }
-       public function setPort( $port ) { $this->setComponent( 'port', $port ); }
-       public function setPath( $path ) { $this->setComponent( 'path', $path ); }
-       public function setFragment( $fragment ) { $this->setComponent( 'fragment', $fragment ); }
-
-       /**
-        * Gets the protocol-authority delimiter of a URI (:// or //).
-        * @return string|null
-        */
-       public function getDelimiter() {
-               $delimiter = $this->getComponent( 'delimiter' );
-               if ( $delimiter ) {
-                       // A specific delimiter is set, so return it.
-                       return $delimiter;
-               }
-               if ( $this->getAuthority() && $this->getProtocol() ) {
-                       // If the URI has a protocol and a body (i.e., some sort of host, etc.)
-                       // the default delimiter is "://", e.g., "http://test.com".
-                       return '://';
-               }
-               return null;
-       }
-
-       /**
-        * Gets query portion of a URI in array format.
-        * @return string
-        */
-       public function getQuery() {
-               return wfCgiToArray( $this->getQueryString() );
-       }
-
-       /**
-        * Gets query portion of a URI.
-        * @param string|array $query
-        */
-       public function setQuery( $query ) {
-               if ( is_array( $query ) ) {
-                       $query = wfArrayToCGI( $query );
-               }
-               $this->setComponent( 'query', $query );
-       }
-
-       /**
-        * Extend the query -- supply query parameters to override or add to ours
-        * @param Array|string $parameters query parameters to override or add
-        * @return Uri this URI object
-        */
-       public function extendQuery( $parameters ) {
-               if ( !is_array( $parameters ) ) {
-                       $parameters = wfCgiToArray( $parameters );
-               }
-
-               $query = $this->getQuery();
-               foreach( $parameters as $key => $value ) {
-                       $query[$key] = $value;
-               }
-
-               $this->setQuery( $query );
-               return $this;
-       }
-
-       /**
-        * Returns user and password portion of a URI.
-        * @return string
-        */
-       public function getUserInfo() {
-               $user = $this->getComponent( 'user' );
-               $pass = $this->getComponent( 'pass' );
-               return $pass ? "$user:$pass" : $user;
-       }
-
-       /**
-        * Gets host and port portion of a URI.
-        * @return string
-        */
-       public function getHostPort() {
-               $host = $this->getComponent( 'host' );
-               $port = $this->getComponent( 'port' );
-               return $port ? "$host:$port" : $host;
-       }
-
-       /**
-        * Returns the userInfo and host and port portion of the URI.
-        * In most real-world URLs, this is simply the hostname, but it is more general.
-        * @return string
-        */
-       public function getAuthority() {
-               $userinfo = $this->getUserInfo();
-               $hostinfo = $this->getHostPort();
-               return $userinfo ? "$userinfo@$hostinfo" : $hostinfo;
-       }
-
-       /**
-        * Returns everything after the authority section of the URI
-        * @return String
-        */
-       public function getRelativePath() {
-               $path = $this->getComponent( 'path' );
-               $query = $this->getComponent( 'query' );
-               $fragment = $this->getComponent( 'fragment' );
-
-               $retval = $path;
-               if( $query ) {
-                       $retval .= "?$query";
-               }
-               if( $fragment ) {
-                       $retval .= "#$fragment";
-               }
-               return $retval;
-       }
-
-       /**
-        * Gets the entire URI string. May not be precisely the same as input due to order of query arguments.
-        * @return String the URI string
-        */
-       public function toString() {
-               return $this->getComponent( 'scheme' ) . $this->getDelimiter() . $this->getAuthority() . $this->getRelativePath();
-       }
-
-       /**
-        * Gets the entire URI string. May not be precisely the same as input due to order of query arguments.
-        * @return String the URI string
-        */
-       public function __toString() {
-               return $this->toString();
-       }
-
-}
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 61061b2..ae5335b 100644 (file)
@@ -2621,12 +2621,15 @@ abstract class DatabaseBase implements DatabaseType {
         * Returns an SQL expression for a simple conditional.  This doesn't need
         * to be overridden unless CASE isn't supported in your DBMS.
         *
-        * @param $cond String: SQL expression which will result in a boolean value
+        * @param $cond string|array SQL expression which will result in a boolean value
         * @param $trueVal String: SQL expression to return if true
         * @param $falseVal String: SQL expression to return if false
         * @return String: SQL fragment
         */
        public function conditional( $cond, $trueVal, $falseVal ) {
+               if ( is_array( $cond ) ) {
+                       $cond = $this->makeList( $cond, LIST_AND );
+               }
                return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
        }
 
index 8f8f5e8..457bf38 100644 (file)
@@ -1406,9 +1406,6 @@ SQL;
                if ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
                        $postLimitTail .= ' FOR UPDATE';
                }
-               if ( isset( $noKeyOptions['LOCK IN SHARE MODE'] ) ) {
-                       $postLimitTail .= ' LOCK IN SHARE MODE';
-               }
                if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) {
                        $startOpts .= 'DISTINCT';
                }
index 1ad25ae..d02bcf5 100644 (file)
@@ -133,70 +133,156 @@ class MWDebug {
         * Adds a warning entry to the log
         *
         * @since 1.19
-        * @param $msg
-        * @param int $callerOffset
+        * @param $msg string
+        * @param $callerOffset int
         * @return mixed
         */
-       public static function warning( $msg, $callerOffset = 1 ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
+       public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
+               $callerDescription = self::getCallerDescription( $callerOffset );
 
-               // Check to see if there was already a deprecation notice, so not to
-               // get a duplicate warning
-               $logCount = count( self::$log );
-               $caller = wfGetCaller( $callerOffset + 1 );
-               if ( $logCount ) {
-                       $lastLog = self::$log[ $logCount - 1 ];
-                       if ( $lastLog['type'] == 'deprecated' && $lastLog['caller'] == $caller ) {
-                               return;
-                       }
-               }
+               self::sendWarning( $msg, $callerDescription, $level );
 
-               self::$log[] = array(
-                       'msg' => htmlspecialchars( $msg ),
-                       'type' => 'warn',
-                       'caller' => $caller,
-               );
+               if ( self::$enabled ) {
+                       self::$log[] = array(
+                               'msg' => htmlspecialchars( $msg ),
+                               'type' => 'warn',
+                               'caller' => $callerDescription['func'],
+                       );
+               }
        }
 
        /**
-        * Adds a depreciation entry to the log, along with a backtrace
+        * Show a warning that $function is deprecated.
+        * This will send it to the following locations:
+        * - Debug toolbar, with one item per function and caller, if $wgDebugToolbar
+        *   is set to true.
+        * - PHP's error log, with level E_USER_DEPRECATED, if $wgDevelopmentWarnings
+        *   is set to true.
+        * - MediaWiki's debug log, if $wgDevelopmentWarnings is set to false.
         *
         * @since 1.19
-        * @param $function
-        * @param $version
-        * @param $component
+        * @param $function string: Function that is deprecated.
+        * @param $version string|bool: Version in which the function was deprecated.
+        * @param $component string|bool: Component to which the function belongs.
+        *     If false, it is assumbed the function is in MediaWiki core.
+        * @param $callerOffset integer: How far up the callstack is the original
+        *    caller. 2 = function that called the function that called
+        *    MWDebug::deprecated() (Added in 1.20).
         * @return mixed
         */
-       public static function deprecated( $function, $version, $component ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
+       public static function deprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
+               $callerDescription = self::getCallerDescription( $callerOffset );
+               $callerFunc = $callerDescription['func'];
 
-               // Chain: This function -> wfDeprecated -> deprecatedFunction -> caller
-               $caller = wfGetCaller( 4 );
+               $sendToLog = true;
 
                // Check to see if there already was a warning about this function
-               $functionString = "$function-$caller";
-               if ( in_array( $functionString, self::$deprecationWarnings ) ) {
+               if ( isset( self::$deprecationWarnings[$function][$callerFunc] ) ) {
                        return;
+               } elseif ( isset( self::$deprecationWarnings[$function] ) ) {
+                       if ( self::$enabled ) {
+                               $sendToLog = false;
+                       } else {
+                               return;
+                       }
                }
 
-               $version = $version === false ? '(unknown version)' : $version;
-               $component = $component === false ? 'MediaWiki' : $component;
-               $msg = htmlspecialchars( "Use of function $function was deprecated in $component $version" );
-               $msg .= Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
-                       Html::element( 'span', array(), 'Backtrace:' )
-                        . wfBacktrace()
-               );
+               self::$deprecationWarnings[$function][$callerFunc] = true;
 
-               self::$deprecationWarnings[] = $functionString;
-               self::$log[] = array(
-                       'msg' => $msg,
-                       'type' => 'deprecated',
-                       'caller' => $caller,
-               );
+               if ( $version ) {
+                       global $wgDeprecationReleaseLimit;
+                       if ( $wgDeprecationReleaseLimit && $component === false ) {
+                               # Strip -* off the end of $version so that branches can use the
+                               # format #.##-branchname to avoid issues if the branch is merged into
+                               # a version of MediaWiki later than what it was branched from
+                               $comparableVersion = preg_replace( '/-.*$/', '', $version );
+
+                               # If the comparableVersion is larger than our release limit then
+                               # skip the warning message for the deprecation
+                               if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
+                                       $sendToLog = false;
+                               }
+                       }
+
+                       $component = $component === false ? 'MediaWiki' : $component;
+                       $msg = "Use of $function was deprecated in $component $version.";
+               } else {
+                       $msg = "Use of $function is deprecated.";
+               }
+
+               if ( $sendToLog ) {
+                       self::sendWarning( $msg, $callerDescription, E_USER_DEPRECATED );
+               }
+
+               if ( self::$enabled ) {
+                       $logMsg = htmlspecialchars( $msg ) .
+                               Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
+                                       Html::element( 'span', array(), 'Backtrace:' ) . wfBacktrace()
+                               );
+
+                       self::$log[] = array(
+                               'msg' => $logMsg,
+                               'type' => 'deprecated',
+                               'caller' => $callerFunc,
+                       );
+               }
+       }
+
+       /**
+        * Get an array describing the calling function at a specified offset.
+        *
+        * @param $callerOffset integer: How far up the callstack is the original
+        *    caller. 0 = function that called getCallerDescription()
+        * @return array with two keys: 'file' and 'func'
+        */
+       private static function getCallerDescription( $callerOffset ) {
+               $callers = wfDebugBacktrace();
+
+               if ( isset( $callers[$callerOffset] ) ) {
+                       $callerfile = $callers[$callerOffset];
+                       if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
+                               $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
+                       } else {
+                               $file = '(internal function)';
+                       }
+               } else {
+                       $file = '(unknown location)';
+               }
+
+               if ( isset( $callers[$callerOffset + 1] ) ) {
+                       $callerfunc = $callers[$callerOffset + 1];
+                       $func = '';
+                       if ( isset( $callerfunc['class'] ) ) {
+                               $func .= $callerfunc['class'] . '::';
+                       }
+                       if ( isset( $callerfunc['function'] ) ) {
+                               $func .= $callerfunc['function'];
+                       }
+               } else {
+                       $func = 'unknown';
+               }
+
+               return array( 'file' => $file, 'func' => $func );
+       }
+
+       /**
+        * Send a warning either to the debug log or by triggering an user PHP
+        * error depending on $wgDevelopmentWarnings.
+        *
+        * @param $msg string Message to send
+        * @param $caller array caller description get from getCallerDescription()
+        * @param $level error level to use if $wgDevelopmentWarnings is true
+        */
+       private static function sendWarning( $msg, $caller, $level ) {
+               global $wgDevelopmentWarnings;
+
+               $msg .= ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
+
+               if ( $wgDevelopmentWarnings ) {
+                       trigger_error( $msg, $level );
+               } else {
+                       wfDebug( "$msg\n" );
+               }
        }
 
        /**
@@ -207,11 +293,11 @@ class MWDebug {
         * @param $str string
         */
        public static function debugMsg( $str ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
+               global $wgDebugComments, $wgShowDebug;
 
-               self::$debug[] = trim( $str );
+               if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
+                       self::$debug[] = rtrim( $str );
+               }
        }
 
        /**
@@ -283,22 +369,91 @@ class MWDebug {
         * @return string
         */
        public static function getDebugHTML( IContextSource $context ) {
-               if ( !self::$enabled ) {
+               global $wgDebugComments;
+
+               $html = '';
+
+               if ( self::$enabled ) {
+                       MWDebug::log( 'MWDebug output complete' );
+                       $debugInfo = self::getDebugInfo( $context );
+
+                       // Cannot use OutputPage::addJsConfigVars because those are already outputted
+                       // by the time this method is called.
+                       $html = Html::inlineScript(
+                               ResourceLoader::makeLoaderConditionalScript(
+                                       ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
+                               )
+                       );
+               }
+
+               if ( $wgDebugComments ) {
+                       $html .= "<!-- Debug output:\n" .
+                               htmlspecialchars( implode( "\n", self::$debug ) ) .
+                               "\n\n-->";
+               }
+
+               return $html;
+       }
+
+       /**
+        * Generate debug log in HTML for displaying at the bottom of the main
+        * content area.
+        * If $wgShowDebug is false, an empty string is always returned.
+        *
+        * @since 1.20
+        * @return string HTML fragment
+        */
+       public static function getHTMLDebugLog() {
+               global $wgDebugTimestamps, $wgShowDebug;
+
+               if ( !$wgShowDebug ) {
                        return '';
                }
 
-               MWDebug::log( 'MWDebug output complete' );
-               $debugInfo = self::getDebugInfo( $context );
+               $curIdent = 0;
+               $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n<li>";
 
-               // Cannot use OutputPage::addJsConfigVars because those are already outputted
-               // by the time this method is called.
-               $html = Html::inlineScript(
-                       ResourceLoader::makeLoaderConditionalScript(
-                               ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
-                       )
-               );
+               foreach ( self::$debug as $line ) {
+                       $pre = '';
+                       if ( $wgDebugTimestamps ) {
+                               $matches = array();
+                               if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
+                                       $pre = $matches[1];
+                                       $line = substr( $line, strlen( $pre ) );
+                               }
+                       }
+                       $display = ltrim( $line );
+                       $ident = strlen( $line ) - strlen( $display );
+                       $diff = $ident - $curIdent;
 
-               return $html;
+                       $display = $pre . $display;
+                       if ( $display == '' ) {
+                               $display = "\xc2\xa0";
+                       }
+
+                       if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
+                               $ident = $curIdent;
+                               $diff = 0;
+                               $display = '<span style="background:yellow;">' . nl2br( htmlspecialchars( $display ) ) . '</span>';
+                       } else {
+                               $display = nl2br( htmlspecialchars( $display ) );
+                       }
+
+                       if ( $diff < 0 ) {
+                               $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
+                       } elseif ( $diff == 0 ) {
+                               $ret .= "</li><li>\n";
+                       } else {
+                               $ret .= str_repeat( "<ul><li>\n", $diff );
+                       }
+                       $ret .= "<tt>$display</tt>\n";
+
+                       $curIdent = $ident;
+               }
+
+               $ret .= str_repeat( '</li></ul>', $curIdent ) . "</li>\n</ul>\n";
+
+               return $ret;
        }
 
        /**
index d989427..ff0a99e 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Deployment
  */
 
-require_once( dirname(__FILE__) . '/../../maintenance/Maintenance.php' );
+require_once( __DIR__ . '/../../maintenance/Maintenance.php' );
 
 /**
  * Class for handling database updates. Roughly based off of updaters.inc, with
index 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 d7c9563..45f0570 100644 (file)
@@ -153,7 +153,6 @@ abstract class Job {
                $dbw = wfGetDB( DB_MASTER );
                $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
                $affected = $dbw->affectedRows();
-               $dbw->commit( __METHOD__ );
 
                if ( !$affected ) {
                        // Failed, someone else beat us to it
@@ -177,7 +176,6 @@ abstract class Job {
                        // Delete the random row
                        $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
                        $affected = $dbw->affectedRows();
-                       $dbw->commit( __METHOD__ );
 
                        if ( !$affected ) {
                                // Random job gone before we exclusively deleted it
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 2b400e5..08f85bd 100644 (file)
@@ -190,7 +190,7 @@ class UtfNormal {
         */
        static function loadData() {
                if( !isset( self::$utfCombiningClass ) ) {
-                       require_once( dirname(__FILE__) . '/UtfNormalData.inc' );
+                       require_once( __DIR__ . '/UtfNormalData.inc' );
                }
        }
 
index 4c6a22f..72eddd9 100644 (file)
@@ -342,6 +342,7 @@ class CoreParserFunctions {
        static function plural( $parser, $text = '' ) {
                $forms = array_slice( func_get_args(), 2 );
                $text = $parser->getFunctionLang()->parseFormattedNumber( $text );
+               settype( $text, ctype_digit( $text ) ? 'int' : 'float' );
                return $parser->getFunctionLang()->convertPlural( $text, $forms );
        }
 
index ff2a901..991e7a2 100644 (file)
@@ -94,17 +94,17 @@ class DeletedContribsPager extends IndexPager {
                if ( isset( $this->mNavigationBar ) ) {
                        return $this->mNavigationBar;
                }
-               $lang = $this->getLanguage();
-               $fmtLimit = $lang->formatNum( $this->mLimit );
+
                $linkTexts = array(
-                       'prev' => $this->msg( 'pager-newer-n', $fmtLimit )->escaped(),
-                       'next' => $this->msg( 'pager-older-n', $fmtLimit )->escaped(),
+                       'prev' => $this->msg( 'pager-newer-n' )->numParams( $this->mLimit )->escaped(),
+                       'next' => $this->msg( 'pager-older-n' )->numParams( $this->mLimit )->escaped(),
                        'first' => $this->msg( 'histlast' )->escaped(),
                        'last' => $this->msg( 'histfirst' )->escaped()
                );
 
                $pagingLinks = $this->getPagingLinks( $linkTexts );
                $limitLinks = $this->getLimitLinks();
+               $lang = $this->getLanguage();
                $limits = $lang->pipeList( $limitLinks );
 
                $this->mNavigationBar = "(" . $lang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
index 39a8a39..6dde6b9 100644 (file)
@@ -329,7 +329,7 @@ class PageArchive {
         * on success, false on failure
         */
        function undelete( $timestamps, $comment = '', $fileVersions = array(), $unsuppress = false, User $user = null ) {
-               global $wgContLang, $wgUser;
+               global $wgUser;
 
                // If both the set of text revisions and file revisions are empty,
                // restore everything. Otherwise, just restore the requested items.
index fdd2b1a..c11d719 100644 (file)
@@ -70,14 +70,13 @@ class UploadFromUrl extends UploadBase {
                if ( !count( $wgCopyUploadsDomains ) ) {
                        return true;
                }
-               $uri = new Uri( $url );
-               $parsedDomain = $uri->getHost();
-               if ( $parsedDomain === null ) {
+               $parsedUrl = wfParseUrl( $url );
+               if ( !$parsedUrl ) {
                        return false;
                }
                $valid = false;
                foreach( $wgCopyUploadsDomains as $domain ) {
-                       if ( $parsedDomain === $domain ) {
+                       if ( $parsedUrl['host'] === $domain ) {
                                $valid = true;
                                break;
                        }
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..de0f4ff 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
@@ -62,7 +62,7 @@ class KkConverter extends LanguageConverter {
        }
 
        function loadDefaultTables() {
-               // require( dirname(__FILE__)."/../../includes/KkConversion.php" );
+               // require( __DIR__."/../../includes/KkConversion.php" );
                // Placeholder for future implementing. Remove variables declarations
                // after generating KkConversion.php
                $kk2Cyrl = array();
index 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 92fb0b7..9529363 100644 (file)
@@ -808,6 +808,7 @@ $2
 'note' => "'''تێبینی:'''",
 'previewnote' => "'''لە بیرت نەچێت ئەمە تەنیا پێشبینینە.'''
 گۆڕانکارییەکانت ھێشتا پاشەکەوت نەکراون!",
+'continue-editing' => 'بەردەوام بە لەدەستکاریکردن',
 'previewconflict' => 'ئەم پێشبینینە بە تۆ نیشان ئەدات ئەو دەقەی لە شوێنی دەستکاری سەرەوە داتناوە چۆن بەرچاو ئەکەوێت ئەگەر پاشەکەوتی بکەیت.',
 'session_fail_preview' => "'''ببوورە! ناتوانین دەستکارییەکەت پێواژۆ بکەین بە ھۆی لەدەستدانی session data.'''
 تکایە دیسان ھەوڵبدەوە.
@@ -1697,6 +1698,7 @@ $1',
 **لادان لە مافەکانی بڵاوکردنەوە
 ***پەڕگەی دووبارەکراوە',
 'filedelete-edit-reasonlist' => 'دەستکاری هۆکارەکانی سڕینەوە',
+'filedelete-maintenance-title' => 'ناتوانیت پەڕگە بسڕیتەوە',
 
 # MIME search
 'mimesearch' => 'گەڕانی MIME',
@@ -1759,7 +1761,7 @@ $1',
 ئێستا ڕەوانکەرە بۆ [[$2]].',
 'double-redirect-fixer' => 'چارەسەرکەری ڕەوانکەر',
 
-'brokenredirects' => 'ڕەوانەکراوە شکاوەکان',
+'brokenredirects' => 'ڕەوانەکەرە شکاوەکان',
 'brokenredirectstext' => 'ئەم ڕەوانەکراوانە بەستەرن بۆ ئەو پەڕانە کە بوونیان نییە:',
 'brokenredirects-edit' => 'دەستکاری',
 'brokenredirects-delete' => 'سڕینەوە',
@@ -1872,6 +1874,9 @@ $1',
 'allpages-bad-ns' => '{{SITENAME}} ناوبۆشایی نیە "$1".',
 'allpages-hide-redirects' => 'ڕەوانەکراوەکان بشارەوە',
 
+# SpecialCachedPage
+'cachedspecial-refresh-now' => 'دواترین پیشانبدە',
+
 # Special:Categories
 'categories' => 'پۆلەكان',
 'categoriespagetext' => 'ئەم {{PLURAL:$1|پۆلە پەڕە یان پەڕگەی|پۆلانە پەڕە یان پەڕگەیان}} لەخۆگرتە.
@@ -2100,7 +2105,7 @@ $UNWATCHURL
 'protectedarticle' => '«[[$1]]»ی پاراست',
 'modifiedarticleprotection' => 'ئاستی پاراستنی «[[$1]]»ی گۆڕا',
 'unprotectedarticle' => 'پاراستنی لەسەر «[[$1]]» لابرد',
-'movedarticleprotection' => 'ڕێککارییەکانی پاراستن لە  "[[$2]]" گوازرایەوە بۆ "[[$1]]"',
+'movedarticleprotection' => 'ڕێککارییەکانی پاراستن لە  «[[$2]]» گوازرایەوە بۆ «[[$1]]»',
 'protect-title' => 'گۆڕینی ئاستی پاراستنی "$1"',
 'prot_1movedto2' => '[[$1]] گوازرایەوە بۆ [[$2]]',
 'protect-legend' => 'پاراستن تەیید بکە',
@@ -2425,7 +2430,7 @@ $1',
 'movepagebtn' => 'ئەم پەڕەیە بگوازەوە',
 'pagemovedsub' => 'گواستنەوە بە سەرکەوتوویی جێبەجێ کرا',
 'movepage-moved' => "'''«$1» گوازرایەوە بۆ «$2»'''",
-'movepage-moved-redirect' => 'ڕەوانکەرێک درووست‌کرا.',
+'movepage-moved-redirect' => 'ڕەوانەکەرێک دروست کرا.',
 'movepage-moved-noredirect' => 'لە دانانی ڕەوانەکەر بەرگری کرا.',
 'articleexists' => 'پەڕەیەک بەم ناوە ھەیە یان ئەو ناوەی تۆ ھەڵتبژاردووە ڕێگەی پێنەدراوە.
 تکایە ناوێکی دیکە ھەڵبژێرە.',
@@ -2435,7 +2440,7 @@ $1',
 'movedto' => 'گواسترایەوە بۆ',
 'movetalk' => 'پەڕەی وتووێژی پەیوەندیدار بگوازەوە',
 'move-subpages' => 'ژێرپەڕەکانی بگوازەوە (ھەتا $1 پەڕە)',
-'move-talk-subpages' => 'ژێرپەڕەکانی پەڕەی وتووێژی بگۆزەرەوە (ھەتاکوو $1)',
+'move-talk-subpages' => 'ژێرپەڕەکانی پەڕەی وتووێژ بگوازەوە (ھەتا $1 پەڕە)',
 'movepage-page-exists' => 'پەڕەی $1 هەیە و ناتوانرێت خۆکار بخرێتە جێی.',
 'movepage-page-moved' => 'پەڕەی $1 گۆزرایەوە بۆ $2.',
 'movepage-page-unmoved' => 'ناکرێ پەڕەی $1 بگوێزرێتەوە بۆ $2.',
@@ -2444,7 +2449,7 @@ $1',
 'movelogpagetext' => 'لە خوارەوەدا لیستی ھەموو پەڕە گواستنەوەکان دەبینن.',
 'movesubpage' => '{{PLURAL:$1|ژێرپەڕە|ژێرپەڕە}}',
 'movesubpagetext' => 'ئەم لاپەڕە $1 {{PLURAL:$1|ژێرلاپەڕەی‌|ژێرلاپەڕەی}} هەیە کە لەخوارە نیشان دراوە.',
-'movenosubpage' => 'ئەم پەڕە ھیچ ژێرپەڕەیەکی نییە.',
+'movenosubpage' => 'ئەم پەڕەیە ھیچ ژێرپەڕەیەکی نییە.',
 'movereason' => 'ھۆکار:',
 'revertmove' => 'پێچەوانەکردنەوە',
 'delete_and_move' => 'بیسڕەوە و بیگوازەوە',
@@ -2663,9 +2668,11 @@ $1',
 
 # Info page
 'pageinfo-title' => 'زانیاری بۆ «$1»',
+'pageinfo-header-basic' => 'زانیاریی سەرەتایی',
 'pageinfo-header-edits' => 'دەستکاریەکان',
 'pageinfo-views' => 'ژمارەی بینینەکان',
 'pageinfo-watchers' => 'ژمارەی چاودێران',
+'pageinfo-firstuser' => 'دروستکەری پەڕە',
 'pageinfo-edits' => 'ژمارەی دەستکارییەکان',
 
 # Skin names
@@ -2777,8 +2784,11 @@ $1',
 'exif-imagelength' => 'بەرزی',
 'exif-imagedescription' => 'ناونیشانی وێنە',
 'exif-model' => 'جۆری کامێرا',
+'exif-software' => 'نەرمەواڵەی بەکارهاتوو',
 'exif-artist' => 'نووسەر',
 'exif-colorspace' => 'بۆشایی ره‌نگ',
+'exif-pixelydimension' => 'پانی وێنە',
+'exif-pixelxdimension' => 'بەرزی وێنە',
 'exif-usercomment' => 'بۆچوونەکانی بەکارهێنەر',
 'exif-relatedsoundfile' => 'فایلی ده‌نگی لێکچوو',
 'exif-lightsource' => 'سەرچاوەی ڕووناکی',
@@ -2794,6 +2804,10 @@ $1',
 'exif-gpstrack' => 'ئاڕاستەی جوڵان',
 'exif-gpsimgdirection' => 'ئاڕاستەی وێنە',
 'exif-gpsdatestamp' => 'ڕێکەوتی GPS',
+'exif-objectname' => 'سەردێری کورت',
+'exif-headline' => 'سەردێر',
+'exif-source' => 'سەرچاوە',
+'exif-copyrighted' => 'ڕەوشی مافی لەبەرگرتنەوە',
 
 # EXIF attributes
 'exif-compression-1' => 'نەپەستێنراو',
@@ -2903,6 +2917,18 @@ $1',
 'exif-gpsspeed-k' => 'کیلۆمەتر هەر کاتژمێر',
 'exif-gpsspeed-m' => 'مایل هەر کاتژمێر',
 
+# Pseudotags used for GPSDestDistanceRef
+'exif-gpsdestdistance-k' => 'کیلۆمەتر',
+'exif-gpsdestdistance-m' => 'میل',
+'exif-gpsdestdistance-n' => 'میکی دەریایی',
+
+'exif-dc-date' => 'ڕۆژ(ەکان)',
+'exif-dc-publisher' => 'بڵاوکار',
+'exif-dc-relation' => 'پەڕگەی پەیوەندیدار',
+'exif-dc-rights' => 'مافەکان',
+'exif-dc-source' => 'سەرچاوەی پەڕگە',
+'exif-dc-type' => 'جۆری پەڕگە',
+
 'exif-iimcategory-hth' => 'تەندروستی',
 'exif-iimcategory-sci' => 'زانست و تەکنۆلۆژیا',
 'exif-iimcategory-soi' => 'بابەتە کۆمەڵایەتییەکان',
index 8e97155..1e17799 100644 (file)
@@ -1985,6 +1985,7 @@ listeya ke ha ver a têna na {{PLURAL:$1|dosyaya ewwili|dosyaya $1 ewwili}} mocn
 'shared-repo' => 'yew embarê repositoryî',
 'shared-repo-name-wikimediacommons' => 'Wikimedia Commons',
 'filepage.css' => '/* CSS placed here is included on the file description page, also included on foreign client wikis */',
+'upload-disallowed-here' => 'Nê asengi sero theba nênusneyêno.',
 
 # File reversion
 'filerevert' => '$1 reyna biyere',
@@ -3089,7 +3090,7 @@ Tı eşkeno yew sebeb bınus.',
 'pageinfo-authors' => 'Amarina nuştekaran pêro',
 'pageinfo-recent-edits' => 'Amariya vurnayışan ($1 ra nata)',
 'pageinfo-recent-authors' => 'Amarina nuştekaran pêro',
-'pageinfo-restriction' => 'Xısusiyetê pela da  (<code>$1</code>)',
+'pageinfo-restriction' => 'Xısusiyetê pela (<code>{{lcfirst:$1}}</code>)',
 'pageinfo-magic-words' => '{{PLURAL:$1|Çekuya|Çekuyê}} ($1) sihırini',
 'pageinfo-hidden-categories' => '{{PLURAL:$1|Kategoriye|Kategoriyan}} ($1) bınımne',
 'pageinfo-templates' => '{{PLURAL:$1|Şablon|Şabloni}} ($1) açarneyayê',
@@ -3148,6 +3149,7 @@ Gurênayışê nae de, beno ke sistemê şıma zerar bıvêno.",
 'file-info-size-pages' => '$1 × $2 pikse, dergeya dosyay: $3, MIME tipiya cı: $4, $5 {{PLURAL:$5|pela|pela}}',
 'file-nohires' => 'Rovıleşiyayışo berzêr çıniyo.',
 'svg-long-desc' => 'SVG dosya, nominalin $1 × $2 piksels, ebatê dosya: $3',
+'svg-long-desc-animated' => 'SVG dosya, nominalin $1 × $2 piksela, ebatê dosya: $3',
 'show-big-image' => 'Resolosyonê temami',
 'show-big-image-preview' => "Verqayd dergiya: $1'i.",
 'show-big-image-other' => 'Zewmi{{PLURAL:$2|Vılêşnayış|Vılêşnayışê}}: $1.',
@@ -3157,6 +3159,8 @@ Gurênayışê nae de, beno ke sistemê şıma zerar bıvêno.",
 'file-info-png-looped' => 'atlama biyo',
 'file-info-png-repeat' => '$1 {{PLURAL:$1|hew|hew}} kay biyê',
 'file-info-png-frames' => '$1 {{PLURAL:$1|çerçeve|çerçeveyi}}',
+'file-no-thumb-animation' => "'''Not: Dılet tekniko limit, gırd agozneya resm de qıckek de animasyoni miyan dı nêbo.'''",
+'file-no-thumb-animation-gif' => "'''Not: Dılet tekniko limit, gırd agozneya resm de qıckek de  GIF imaci de animasyon do nêbo.'''",
 
 # Special:NewFiles
 'newimages' => 'Galeriya dosyayan dê newan',
index 23349b8..83abaea 100644 (file)
@@ -251,7 +251,7 @@ $messages = array(
 'otherlanguages' => 'Ann an cànain eile',
 'redirectedfrom' => '(Air ath-sheòladh o $1)',
 'redirectpagesub' => 'Ath-sheòl an duilleag',
-'lastmodifiedat' => 'Chaidh an duilleag seo a mhùthadh $1, aig $2 turas mu dheireadh.',
+'lastmodifiedat' => 'Chaidh an duilleag seo a mhùthadh $1 aig $2 turas mu dheireadh.',
 'viewcount' => 'Chaidh inntrigeadh a dhèanam dhan duilleag seo {{PLURAL:$1|aon turas|$1 thuras|$1 turas|$1 turais|$1 turas}}.',
 'protectedpage' => 'Duilleag fo dhìon',
 'jumpto' => 'Gearr leum gu:',
@@ -731,8 +731,13 @@ Mur obraich e fhathast, feuch is [[Special:UserLogout|clàraich a-mach]] is a-st
 
 '''Mas e deasachadh dligheach a tha seo, feuch ris a-rithist.'''
 Mur obraich e fhathast, feuch is [[Special:UserLogout|clàraich a-mach]] is a-steach a-rithist an uairsin.",
+'token_suffix_mismatch' => "'''Dhiùlt sinn na dheasaich thu a chionn 's gun do chuir an cliant agad na caractaran puingeachaidh tro chèile san tòcan deasachaidh.'''
+Dhiùlt sinn na dheasaich thu air eagal 's gun coirbeadh e teacsa na duilleige.
+Tachraidh seo uaireannan ma chleachdar seirbheis-lìn progsaidh gun urra a tha làn de mhearachdan.",
+'edit_form_incomplete' => "'''Cha do ràinig cuid dhen fhoirm deasachaidh am frithealaichte; dèan cinnteach gu bheil gach deasachadh agad slàn is feuch ris a-rithist.'''",
 'editing' => "A' deasachadh $1",
 'editingsection' => "A' deasachadh $1 (earrann)",
+'editingcomment' => "A' deasachadh $1 (earrann ùr)",
 'editconflict' => 'Còmhstri deasachaidh: $1',
 'explainconflict' => "Tha cuideigin eile air an duilleag seo a mhùthadh on a thòisich thu fhèin air a dheasachadh.
 Tha am bogsa teacsa gu h-àrd a' nochdadh na duilleige mar a tha i an-dràsta.
@@ -741,6 +746,8 @@ Bidh agad ris na mùthaidhean agad fhilleadh a-steach san teacsa làithreach.
 Cha dèid '''ach an teacsa gu h-àrd''' a shàbhaladh nuair a bhriogas tu air \"{{int:savearticle}}\".",
 'yourtext' => 'An teacsa agad',
 'storedversion' => 'Lethbhreac taisgte',
+'nonunicodebrowser' => "'''Rabhadh: Chan eil am brabhsair agad co-chòrdail le Unicode.'''
+Chuir sinn gleus air dòigh dhut a nì cinnteach gun urrainn dhut duilleagan a shàbhaladh gu tèarainte: Nochdaidh caractaran taobh a-muigh ASCII mar chòd sia-dheicheach sa bhogsa deasachaidh.",
 'editingold' => "'''RABHADH: Tha thu a' deasachadh lethbhreac seann-aimsireil na duilleige seo.
 Ma shàbhalas tu seo, thèid gach mùthadh air chall a rinneadh a-mach on mhùthadh seo.'''",
 'yourdiff' => 'Caochlaidhean',
@@ -752,10 +759,22 @@ Tha thu a' toirt geall cuideachd gun do sgrìobh thu fhèin seo no gun do rinn t
 Mur eil thu ag iarraidh an sgrìobhaidh agad a dheasaichear is a sgaoilear le càch, na cuir e.<br />
 Ma dh'fhoilleachas tu rudeigin an seo, bidh tu a' dearbhadh gun do sgrìobh thu fhèin e, no gur ann às an raon phòballach a thàinig e; thoir aire '''nach eil''' sin a' gabhail a-staigh duilleagan-lìn mar as àbhaist (seall $1 airson barrachd fiosrachaidh). <br />
 '''NA CLEACHDAIBH SAOTHAIR FO DHLIGHE-SGRÌOBHAIDH GUN CHEAD!'''",
+'longpageerror' => "'''Mearachd: Tha an teacsa a chur thu thugainn {{PLURAL:$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|}} a dh'fhaid is tha sin nas fhaide na tha ceadaichte ({{PLURAL:$1 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|}}).'''
+Cha ghabh a shàbhaladh.",
+'readonlywarning' => "'''Rabhadh: Chaidh an stòr-dàta a ghlasadh a chum obair-ghlèidhidh agus chan urrainn dhut na còraichean-deasachaidh agad a chur gu feum an-dràsta fhèin.'''
+'S mathaid gum b' fheairrde dhut lethbhreac a dhèanamh dhen teacsa agus a shàbhaladh ann am faidhle ach an urrainn dhut a chleachdadh as a dhèidh seo.
+
+Seo am mìneachadh a thug an rianaire a ghlais e: $1",
 'protectedpagewarning' => "'''Rabhadh: Chaidh an duilleag seo a dhìon 's chan urrainn ach dhan fheadhainn aig a bheil ùghdarras rianaire a dheasachadh.'''
 Chì thu an clàr mu dheireadh san loga mar fhiosrachadh dhut gu h-ìosal:",
+'semiprotectedpagewarning' => "'''An aire:''' Chaidh an duilleag seo a dhìon 's chan fhaod ach cleachdaichean clàraichte a dheasachadh.
+Seo an rud mu dheireadh san loga mar fhiosrachadh dhut:",
+'cascadeprotectedwarning' => "'''Rabhadh:''' Chaidh an duilleag seo a dhìon 's chan fhaod ach rianairean a dheasachadh a chionn 's gun robh e am broinn {{PLURAL:$1|na duilleige|nan duilleagan}} a leanas a tha cascade-protected.",
+'titleprotectedwarning' => "'''Rabhadh: Chaidh an duilleag seo a dhìon 's feumar [[Special:ListGroupRights|còraichean sònraichte]] gus a dheasachadh.'''
+Seo an rud mu dheireadh san loga mar fhiosrachadh dhut:",
 'templatesused' => "Tha {{PLURAL:$1|teamplaid|theamplaid||teamplaid|theamplaid|teamplaidean|teamplaid}} 'gan cleachdadh air an duilleag seo:",
 'templatesusedpreview' => "Tha {{PLURAL:$1|teamplaid 'ga cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh}} san ro-shealladh seo:",
+'templatesusedsection' => "Tha {{PLURAL:$1|teamplaid 'ga cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh}} san earrann seo:",
 'template-protected' => '(air a dhìon)',
 'template-semiprotected' => '(air a leth-dhìon)',
 'hiddencategories' => "Tha an duilleag seo 'na ball de {{PLURAL:$1|1 roinn-seòrsa fhalaichte|$1 roinn-seòrsa fhalaichte|1 roinn-seòrsa fhalaichte|$1 roinn-seòrsa fhalaichte|$1 roinnean-seòrsa falaichte|$1 roinn-seòrsa fhalaichte}}:",
index a97ec76..2986d89 100644 (file)
@@ -927,7 +927,7 @@ I dettagli possono essere trovati nel [{{fullurl:{{#Special:Log}}/delete|page={{
 L'ultimo elemento del registro dei blocchi è riportato di seguito per informazione:",
 'clearyourcache' => "'''Nota:''' dopo aver salvato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti. 
 *'''Firefox / Safari''': tenere premuto il tasto delle maiuscole e fare clic su ''Ricarica'', oppure premere ''Ctrl-F5'' o ''Ctrl-R'' (''⌘-R'' su Mac)
-*'''Google Chrome''': premere ''Ctrl-Shift-R'' (''⌘-Shift-R'' su un Mac)
+*'''Google Chrome''': fare clic su ''Ricarica'', oppure premere ''Ctrl-R'' o ''Ctrl-Shift-R'' (''⌘-Shift-R'' su un Mac)
 *'''Internet Explorer''': tenere premuto il tasto ''Ctrl'' mentre si fa clic su ''Refresh'', oppure premere ''Ctrl-F5''
 *'''Opera''': svuotare completamente la cache dal menu ''Strumenti → Preferenze''",
 'usercssyoucanpreview' => "'''Suggerimento:''' usa il pulsante 'Visualizza anteprima' per provare il tuo nuovo CSS prima di salvarlo.",
index 5e4ec33..80f5376 100644 (file)
@@ -887,9 +887,9 @@ Cookieを有効にしていることを確認して、このページを再読
 'resetpass_announce' => 'メールでお送りした仮パスワードでログインしました。
 ログインを完了するには、ここで新しいパスワードを設定する必要があります:',
 'resetpass_text' => '<!-- ここに文を挿入 -->',
-'resetpass_header' => 'ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83\91ã\82¹ã\83¯ã\83¼ã\83\89ã\82\92変更',
-'oldpassword' => '古いパスワード',
-'newpassword' => '新しいパスワード',
+'resetpass_header' => 'ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83\91ã\82¹ã\83¯ã\83¼ã\83\89ã\81®変更',
+'oldpassword' => '古いパスワード:',
+'newpassword' => '新しいパスワード:',
 'retypenew' => '新しいパスワードを再入力:',
 'resetpass_submit' => '再設定してログイン',
 'resetpass_success' => 'パスワードの変更に成功しました!
@@ -2928,8 +2928,8 @@ hideuser権限を持っていないため、この利用者のブロックを閲
 手動で統合してください。'''",
 'movedto' => '移動先:',
 'movetalk' => '付随するトークページも移動',
-'move-subpages' => '下位ページも移動($1ページまで)',
-'move-talk-subpages' => 'トークページの下位ページも移動($1まで)',
+'move-subpages' => '下位ページも移動($1 件まで)',
+'move-talk-subpages' => 'トークページの下位ページも移動($1 件まで)',
 'movepage-page-exists' => 'ページ「$1」は既に存在するため、自動的な上書きはできませんでした。',
 'movepage-page-moved' => 'ページ「$1」は「$2」に移動しました。',
 'movepage-page-unmoved' => 'ページ「$1」は「$2」に移動できませんでした。',
@@ -2937,7 +2937,7 @@ hideuser権限を持っていないため、この利用者のブロックを閲
 'movelogpage' => '移動記録',
 'movelogpagetext' => '以下はすべてのページ移動の一覧です。',
 'movesubpage' => '{{PLURAL:$1|下位ページ}}',
-'movesubpagetext' => 'このページには{{PLURAL:$1|下位ページ}}が以下の $1 件あります。',
+'movesubpagetext' => 'このページには、以下の $1 {{PLURAL:$1|下位ページ}}があります。',
 'movenosubpage' => 'このページに下位ページはありません。',
 'movereason' => '理由:',
 'revertmove' => '差し戻し',
@@ -3397,6 +3397,11 @@ Variants for Chinese language
 'variantname-ike-latn' => 'イヌクティトゥット語 (ラテン文字)',
 'variantname-iu' => 'イヌクティトゥット語',
 
+# Variants for Tachelhit language
+'variantname-shi-tfng' => 'シルハ語 (ティフィナグ文字)',
+'variantname-shi-latn' => 'シルハ語 (ラテン文字)',
+'variantname-shi' => 'シルハ語',
+
 # Metadata
 'metadata' => 'メタデータ',
 'metadata-help' => 'このファイルには、追加情報があります(おそらく、作成やデジタル化する際に使用したデジタルカメラやスキャナーが追加したものです)。
index cfb4bab..f2f8323 100644 (file)
@@ -16,6 +16,7 @@
  * @author Junaidpv
  * @author Jyothis
  * @author Kaganer
+ * @author Krenair
  * @author Manjith Joseph <manjithkaini@gmail.com>
  * @author Naveen Sankar
  * @author Praveen Prakash <me.praveen@gmail.com>
@@ -962,8 +963,8 @@ $1 ആണ് ഈ തടയൽ നടത്തിയത്. ''$2'' എന്ന
 'newarticle' => '(പുതിയത്)',
 'newarticletext' => 'ഇതുവരെ നിലവിലില്ലാത്ത ഒരു താൾ സൃഷ്ടിക്കാനുള്ള ശ്രമത്തിലാണ് താങ്കൾ. അതിനായി താഴെ ആവശ്യമുള്ള വിവരങ്ങൾ എഴുതിച്ചേർത്ത് സേവ് ചെയ്യുക (കൂടുതൽ വിവരങ്ങൾക്ക് [[{{MediaWiki:Helppage}}|സഹായം താൾ]] കാണുക). താങ്കളിവിടെ അബദ്ധത്തിൽ വന്നതാണെങ്കിൽ ബ്രൗസറിന്റെ ബാക്ക് ബട്ടൺ ഞെക്കിയാൽ തിരിച്ചുപോകാം.',
 'anontalkpagetext' => "----
-{| class=\"messagebox standard-talk\" style=\"border: 1px solid #B3B300; background-color:#FFFFBF;\"
-|align=\"left\" |
+{| class=\"messagebox standard-talk\" style=\"border: 1px solid #B3B300; background-color:#FFFFBF; text-align: left;\"
+|
 ''ഇതുവരെ അംഗത്വം എടുക്കാതിരിക്കുകയോ, നിലവിലുള്ള അംഗത്വം ഉപയോഗിക്കാതിരിക്കുകയോ ചെയ്യുന്ന '''ഒരു അജ്ഞാത ഉപയോക്താവിന്റെ സം‌വാദം താളാണിത്'''.
 അതിനാൽ അദ്ദേഹത്തെ തിരിച്ചറിയുവാൻ അക്കരൂപത്തിലുള്ള ഐ.പി. വിലാസം ഉപയോഗിക്കേണ്ടതുണ്ട്. ഇത്തരം ഒരു ഐ.പി. വിലാസം പല ഉപയോക്താക്കൾ പങ്കുവെക്കുന്നുണ്ടാവാം.
 താങ്കൾ ഈ സന്ദേശം ലഭിച്ച ഒരു അജ്ഞാത ഉപയോക്താവാണെങ്കിൽ, ഭാവിയിൽ ഇതര ഉപയോക്താക്കളുമായി ഉണ്ടായേക്കാവുന്ന ആശയക്കുഴപ്പം ഒഴിവാക്കാൻ ദയവായി [[Special:UserLogin/signup|ഒരു അംഗത്വമെടുക്കുക]] അല്ലെങ്കിൽ  [[Special:UserLogin|പ്രവേശിക്കുക]].
index 4cef353..b192f98 100644 (file)
@@ -1890,9 +1890,9 @@ delete|ਮਿਟਾਉਣਾਂ ਦਾ ਚਿੱਠਾ]] ਵੇਖੋ।',
 'spamprotectiontitle' => 'Spam ਸੁਰੱਖਿਆ ਫਿਲਟਰ',
 
 # Info page
-'pageinfo-header-edits' => 'ਸੋਧਾਂ',
-'pageinfo-watchers' => 'ਨà¨\9c਼ਰ à¨°à©±à¨\96ਣ à¨µà¨¾à¨²à¨¼à¨¿à¨\86à¨\82 à¨¦à©\80 à¨\97ਿਣਤà©\80',
-'pageinfo-edits' => 'ਸà©\8bਧਾà¨\82 à¨¦à©\80 à¨\97ਿਣਤà©\80',
+'pageinfo-header-edits' => 'ਸੋਧਾਂ ਦਾ ਅਤੀਤ',
+'pageinfo-watchers' => 'ਸਫ਼à©\87 â\80\99ਤà©\87 à¨¨à¨\9c਼ਰ à¨°à©±à¨\96ਣ à¨µà¨¾à¨²à¨¼à©\87',
+'pageinfo-edits' => 'à¨\95à©\81ੱਲ à¨¸à©\8bਧਾà¨\82',
 
 # Skin names
 'skinname-standard' => 'ਕਲਾਸਿਕ',
index e551c96..eec58cc 100644 (file)
@@ -2754,7 +2754,7 @@ A peul visualisene la sorgiss",
 'tooltip-t-permalink' => 'Anliura fissa a sta version-sì dla pàgina',
 'tooltip-ca-nstab-main' => 'Vardé la pàgina ëd contnù.',
 'tooltip-ca-nstab-user' => 'Vardé la pàgina Utent.',
-'tooltip-ca-nstab-media' => 'Vardé la pàgina dl',
+'tooltip-ca-nstab-media' => 'Vardé la pàgina dël mojen',
 'tooltip-ca-nstab-special' => 'Costa a l',
 'tooltip-ca-nstab-project' => 'Vardé la pàgina proteta.',
 'tooltip-ca-nstab-image' => 'Vardé la pàgina dl',
index 8146d9a..148206a 100644 (file)
@@ -7,6 +7,7 @@
  * @ingroup Language
  * @file
  *
+ * @author Arjunaraoc
  * @author Chaduvari
  * @author Jprmvnvijay5
  * @author Kaganer
@@ -692,6 +693,7 @@ $2
 # Special:ChangeEmail
 'changeemail' => 'ఈ-మెయిలు చిరునామా మార్పు',
 'changeemail-header' => 'ఖాతా ఈ-మెయిల్ చిరునామాని మార్చండి',
+'changeemail-text' => 'మీ ఈమెయిల్ చిరునామా మార్చుటకు ఈ ఫారము నింపండి. ఈ మార్పుని ఖచ్చితపరచుటకు మీ సంకేతపదం  ప్రవేశపెట్టాలి.',
 'changeemail-no-info' => 'ఈ పేజీని నేరుగా చూడటానికి మీరు లోనికి ప్రవేశించివుండాలి.',
 'changeemail-oldemail' => 'ప్రస్తుత ఈ-మెయిలు చిరునామా:',
 'changeemail-newemail' => 'కొత్త ఈ-మెయిలు చిరునామా:',
index 5e17126..4ddee10 100644 (file)
@@ -764,6 +764,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'contribslink' => 'kontribuisaun',
 'block-log-flags-nocreate' => 'la bele kria konta foun',
 'block-log-flags-noemail' => 'korreiu eletróniku blokeiu',
+'block-log-flags-nousertalk' => 'la bele edita pájina diskusaun rasik',
 'ipb_already_blocked' => 'Ema ruma blokeiu "$1" tiha ona',
 
 # Move page
index a3b9bba..b726e80 100644 (file)
@@ -1003,6 +1003,7 @@ HTML tags جانچئے.',
 'uploadlogpagetext' => 'درج ذیل میں حالیہ زبراثقال (اپ لوڈ) کی گئی املاف (فائلوں) کی فہرست دی گئی ہے۔',
 'filedesc' => 'خلاصہ',
 'fileuploadsummary' => 'خلاصہ :',
+'filesource' => 'ذرائع',
 'uploadedfiles' => 'زبراثقال ملف (فائل اپ لوڈ)',
 'ignorewarning' => 'انتباہ نظرانداز کرتے ہوۓ بہرصورت ملف (فائل) کو محفوظ کرلیا جاۓ۔',
 'ignorewarnings' => 'ہر انتباہ نظرانداز کردیا جاۓ۔',
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..6da5815 100644 (file)
  * @defgroup Maintenance Maintenance
  */
 
+// Make sure we're on PHP5 or better
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+       require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+       wfPHPVersionError( 'cli' );
+}
+
 /**
  * @defgroup MaintenanceArchive Maintenance archives
  * @ingroup Maintenance
  */
 
 // Define this so scripts can easily find doMaintenance.php
-define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' );
+define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
 define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
 
 $maintClass = false;
 
-// Make sure we're on PHP5 or better
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
-       require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
-       wfPHPVersionError( 'cli' );
-}
 
 /**
  * Abstract maintenance class for quickly writing and churning out
@@ -123,7 +124,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 +989,7 @@ abstract class Maintenance {
         * @return string
         */
        protected function getDir() {
-               return dirname( __FILE__ );
+               return __DIR__;
        }
 
        /**
@@ -1009,9 +1010,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..e369cb1 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
@@ -56,12 +56,9 @@ class ImportSiteScripts extends Maintenance {
                        }
 
                        $this->output( "Importing $page\n" );
-                       $uri = new Uri( $baseUrl );
-                       $uri->extendQuery( array(
+                       $url = wfAppendQuery( $baseUrl, array(
                                'action' => 'raw',
                                'title' => "MediaWiki:{$page}" ) );
-                       $url = $uri->toString();
-
                        $text = Http::get( $url );
 
                        $wikiPage = WikiPage::factory( $title );
@@ -82,9 +79,7 @@ class ImportSiteScripts extends Maintenance {
                $pages = array();
 
                do {
-                       $uri = new Uri( $baseUrl );
-                       $uri->extendQuery( $data );
-                       $url = $uri->toString();
+                       $url = wfAppendQuery( $baseUrl, $data );
                        $strResult = Http::get( $url );
                        //$result = FormatJson::decode( $strResult ); // Still broken
                        $result = unserialize( $strResult );
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 15fa712..b76f921 100644 (file)
@@ -46,7 +46,7 @@ class languages {
         * @param $exif bool Treat the EXIF messages?
         */
        function __construct( $exif = true ) {
-               require( dirname(__FILE__) . '/messageTypes.inc' );
+               require( __DIR__ . '/messageTypes.inc' );
                $this->mIgnoredMessages = $wgIgnoredMessages;
                if ( $exif ) {
                        $this->mOptionalMessages = array_merge( $wgOptionalMessages );
index 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 c1a890b..b0ab624 100644 (file)
@@ -49,7 +49,7 @@
  * @license GNU General Public License 2.0 or later
  */
 
-require_once( dirname(__FILE__) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
 /**
  * Maintenance script to parse some wikitext.
index 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 630b05c..95f028a 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  */
 
-require_once( dirname(__FILE__) . '/includes/WebStart.php' );
+require_once( __DIR__ . '/includes/WebStart.php' );
 
 if( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
        // Makes testing tweaks about a billion times easier
index 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 d8fb2b3..0e0ce80 100644 (file)
@@ -3,7 +3,7 @@
 if ( !defined( 'MEDIAWIKI' ) ) {
        $wgNoDBParam = true;
        $optionsWithArgs = array( 'o' );
-       require_once( dirname(__FILE__).'/../maintenance/commandLine.inc' );
+       require_once( __DIR__ .'/../maintenance/commandLine.inc' );
 
        $stderr = fopen( 'php://stderr', 'w' );
        if ( !isset( $args[0] ) ) {
index d06bdfd..9a3ab94 100644 (file)
@@ -26,7 +26,7 @@ if( !defined( 'MEDIAWIKI' ) )
        die( -1 );
 
 /** */
-require_once( dirname(__FILE__) . '/MonoBook.php' );
+require_once( __DIR__ . '/MonoBook.php' );
 
 /**
  * Inherit main code from SkinTemplate, set the CSS and template filter.
index 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..cb5ca36 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 global $wgAutoloadClasses;
-$testFolder = dirname( __FILE__ );
+$testFolder = __DIR__;
 
 $wgAutoloadClasses += array(
 
@@ -13,7 +13,6 @@ $wgAutoloadClasses += array(
 
        //includes
        'BlockTest' => "$testFolder/phpunit/includes/BlockTest.php",
-       'MockOutputPage' => "$testFolder/phpunit/includes/MockOutputPage.php",
 
        //API
        'ApiFormatTestBase' => "$testFolder/phpunit/includes/api/format/ApiFormatTestBase.php",
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 746add5..9097d30 100644 (file)
@@ -108,7 +108,7 @@ class GlobalTest extends MediaWikiTestCase {
                        array( array( 'foo' => 1 ), 'foo=1' ), // number test
                        array( array( 'foo' => true ), 'foo=1' ), // true test
                        array( array( 'foo' => false ), '' ), // false test
-                       array( array( 'foo' => null ), 'foo' ), // null test
+                       array( array( 'foo' => null ), '' ), // null test
                        array( array( 'foo' => 'A&B=5+6@!"\'' ), 'foo=A%26B%3D5%2B6%40%21%22%27' ), // urlencoding test
                        array( array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), 'foo=bar&baz=is&asdf=qwerty' ), // multi-item test
                        array( array( 'foo' => array( 'bar' => 'baz' ) ), 'foo%5Bbar%5D=baz' ),
@@ -311,7 +311,7 @@ class GlobalTest extends MediaWikiTestCase {
        
        function testDebugFunctionTest() {
        
-               global $wgDebugLogFile, $wgOut, $wgShowDebug, $wgDebugTimestamps;
+               global $wgDebugLogFile, $wgDebugTimestamps;
                
                $old_log_file = $wgDebugLogFile;
                $wgDebugLogFile = tempnam( wfTempDir(), 'mw-' );
@@ -333,33 +333,7 @@ class GlobalTest extends MediaWikiTestCase {
                wfDebug( "\00305This has böth UTF and control chars\003" );
                $this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) );
                unlink( $wgDebugLogFile );
-               
-               
-               
-               $old_wgOut = $wgOut;
-               $old_wgShowDebug = $wgShowDebug;
-               
-               $wgOut = new MockOutputPage;
-               
-               $wgShowDebug = true;
-               
-               $message = "\00305This has böth UTF and control chars\003";
-               
-               wfDebug( $message );
-               
-               if( $wgOut->message == "JAJA is a stupid error message. Anyway, here's your message: $message" ) {
-                       $this->assertTrue( true, 'MockOutputPage called, set the proper message.' );
-               }
-               else {
-                       $this->assertTrue( false, 'MockOutputPage was not called.' );
-               }
-               
-               $wgOut = $old_wgOut;
-               $wgShowDebug = $old_wgShowDebug;                
-               unlink( $wgDebugLogFile );
-               
-               
-               
+
                wfDebugMem();
                $this->assertGreaterThan( 5000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) );
                unlink( $wgDebugLogFile );
diff --git a/tests/phpunit/includes/MockOutputPage.php b/tests/phpunit/includes/MockOutputPage.php
deleted file mode 100644 (file)
index bdee483..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-class MockOutputPage {
-
-       public $message;
-
-       function debug( $message ) {
-               $this->message = "JAJA is a stupid error message. Anyway, here's your message: $message";
-       }
-}
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 {
 
diff --git a/tests/phpunit/includes/UriTest.php b/tests/phpunit/includes/UriTest.php
deleted file mode 100644 (file)
index 3b78f47..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-
-class UriTest extends MediaWikiTestCase {
-
-       function setUp() {
-               AutoLoader::loadClass( 'Uri' );
-       }
-
-       function dataUris() {
-               return array(
-                       array(
-                               'http://example.com/',
-                               array(
-                                       'scheme'    => 'http',
-                                       'delimiter' => '://',
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => 'example.com',
-                                       'port'      => null,
-                                       'path'      => '/',
-                                       'query'     => null,
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               '//mediawiki.org/wiki/Main_Page',
-                               array(
-                                       'scheme'    => null,
-                                       'delimiter' => '//',
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => 'mediawiki.org',
-                                       'port'      => null,
-                                       'path'      => '/wiki/Main_Page',
-                                       'query'     => null,
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               'http://user:pass@example.com/',
-                               array(
-                                       'scheme'    => 'http',
-                                       'delimiter' => '://',
-                                       'user'      => 'user',
-                                       'pass'      => 'pass',
-                                       'host'      => 'example.com',
-                                       'port'      => null,
-                                       'path'      => '/',
-                                       'query'     => null,
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               '/?asdf=asdf',
-                               array(
-                                       'scheme'    => null,
-                                       'delimiter' => null,
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => null,
-                                       'port'      => null,
-                                       'path'      => '/',
-                                       'query'     => 'asdf=asdf',
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               '?asdf=asdf#asdf',
-                               array(
-                                       'scheme'    => null,
-                                       'delimiter' => null,
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => null,
-                                       'port'      => null,
-                                       'path'      => null,
-                                       'query'     => 'asdf=asdf',
-                                       'fragment'  => 'asdf',
-                               ),
-                       )
-               );
-       }
-
-       /**
-        * Ensure that get* methods properly match the appropriate getComponent( key ) value
-        * @dataProvider dataUris
-        */
-       function testGetters( $uri ) {
-               $uri = new Uri( $uri );
-               $getterMap = array(
-                       'getProtocol' => 'scheme',
-                       'getUser' => 'user',
-                       'getPassword' => 'pass',
-                       'getHost' => 'host',
-                       'getPort' => 'port',
-                       'getPath' => 'path',
-                       'getQueryString' => 'query',
-                       'getFragment' => 'fragment',
-               );
-               foreach ( $getterMap as $fn => $c ) {
-                       $this->assertSame( $uri->{$fn}(), $uri->getComponent( $c ), "\$uri->{$fn}(); matches \$uri->getComponent( '$c' );" );
-               }
-       }
-
-       /**
-        * Ensure that Uri has the proper components for our example uris
-        * @dataProvider dataUris
-        */
-       function testComponents( $uri, $components ) {
-               $uri = new Uri( $uri );
-
-               $this->assertSame( $components['scheme'], $uri->getProtocol(), 'Correct scheme' );
-               $this->assertSame( $components['delimiter'], $uri->getDelimiter(), 'Correct delimiter' );
-               $this->assertSame( $components['user'], $uri->getUser(), 'Correct user' );
-               $this->assertSame( $components['pass'], $uri->getPassword(), 'Correct pass' );
-               $this->assertSame( $components['host'], $uri->getHost(), 'Correct host' );
-               $this->assertSame( $components['port'], $uri->getPort(), 'Correct port' );
-               $this->assertSame( $components['path'], $uri->getPath(), 'Correct path' );
-               $this->assertSame( $components['query'], $uri->getQueryString(), 'Correct query' );
-               $this->assertSame( $components['fragment'], $uri->getFragment(), 'Correct fragment' );
-       }
-
-       /**
-        * Ensure that the aliases work for various components.
-        */
-       function testAliases() {
-               $url = "//myuser@test.com";
-               $uri = new Uri( $url );
-
-               // Set the aliases.
-               $uri->setComponent( 'protocol', 'https' );
-               $uri->setComponent( 'password', 'mypass' );
-
-               // Now try getting them.
-               $this->assertSame( 'https', $uri->getComponent( 'protocol' ), 'Correct protocol (alias for scheme)' );
-               $this->assertSame( 'mypass', $uri->getComponent( 'password' ), 'Correct password (alias for pass)' );
-
-               // Finally check their actual names.
-               $this->assertSame( 'https', $uri->getProtocol(), 'Alias for scheme works' );
-               $this->assertSame( 'mypass', $uri->getPassword(), 'Alias for pass works' );
-       }
-
-       /**
-        * Ensure that Uri's helper methods return the correct data
-        */
-       function testHelpers() {
-               $uri = new Uri( 'http://a:b@example.com:8080/path?query=value' );
-
-               $this->assertSame( 'a:b', $uri->getUserInfo(), 'Correct getUserInfo' );
-               $this->assertSame( 'example.com:8080', $uri->getHostPort(), 'Correct getHostPort' );
-               $this->assertSame( 'a:b@example.com:8080', $uri->getAuthority(), 'Correct getAuthority' );
-               $this->assertSame( '/path?query=value', $uri->getRelativePath(), 'Correct getRelativePath' );
-               $this->assertSame( 'http://a:b@example.com:8080/path?query=value', $uri->toString(), 'Correct toString' );
-       }
-
-       /**
-        * Ensure that Uri's extend method properly overrides keys
-        */
-       function testExtend() {
-               $uri = new Uri( 'http://example.org/?a=b&hello=world' );
-               $uri->extendQuery( 'a=c&foo=bar' );
-               $this->assertSame( 'a=c&hello=world&foo=bar', $uri->getQueryString() );
-       }
-}
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 d56e632..0df5a46 100644 (file)
@@ -16,9 +16,9 @@ class DatabaseSQLTest extends MediaWikiTestCase {
        }
 
        /**
-        * @dataProvider dataSQL
+        * @dataProvider dataSelectSQLText
         */
-       function testSQL( $sql, $sqlText ) {
+       function testSelectSQLText( $sql, $sqlText ) {
                $this->assertEquals( trim( $this->db->selectSQLText(
                        isset( $sql['tables'] ) ? $sql['tables'] : array(),
                        isset( $sql['fields'] ) ? $sql['fields'] : array(),
@@ -29,7 +29,7 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                ) ), $sqlText );
        }
 
-       function dataSQL() {
+       function dataSelectSQLText() {
                return array(
                        array(
                                array(
@@ -72,4 +72,36 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                        ),
                );
        }
+
+       /**
+        * @dataProvider dataConditional
+        */
+       function testConditional( $sql, $sqlText ) {
+               $this->assertEquals( trim( $this->db->conditional(
+                       $sql['conds'],
+                       $sql['true'],
+                       $sql['false']
+               ) ), $sqlText );
+       }
+
+       function dataConditional() {
+               return array(
+                       array(
+                               array(
+                                       'conds' => array( 'field' => 'text' ),
+                                       'true' => 1,
+                                       'false' => 'NULL',
+                               ),
+                               "(CASE WHEN field = 'text' THEN 1 ELSE NULL END)"
+                       ),
+                       array(
+                               array(
+                                       'conds' => 'field=1',
+                                       'true' => 1,
+                                       'false' => 'NULL',
+                               ),
+                               "(CASE WHEN field=1 THEN 1 ELSE NULL END)"
+                       ),
+               );
+       }
 }
\ No newline at end of file
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 1627c47..246b291 100644 (file)
@@ -12,6 +12,11 @@ class MWDebugTest extends MediaWikiTestCase {
                }
                /** Clear log before each test */
                MWDebug::clearLog();
+               wfSuppressWarnings();
+       }
+
+       function tearDown() {
+               wfRestoreWarnings();
        }
 
        function testAddLog() {
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 bf5b379..8bca4b0 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -99,4 +99,4 @@ class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFu
         $this->assertTrue( $this->isElementPresent( "submit-back" ));
         $this->assertTrue( $this->isElementPresent( "submit-continue" ));
     }
-}
\ No newline at end of file
+}
index 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..353fa2e 100644 (file)
@@ -27,9 +27,9 @@
  */
 
 require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationConfig.php' );
-require_once ( dirname(__FILE__) . '/MediaWikiInstallationMessage.php' );
-require_once ( dirname(__FILE__) . '/MediaWikiInstallationVariables.php');
+require_once ( __DIR__ . '/MediaWikiInstallationConfig.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationMessage.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationVariables.php');
 
 
 class MediaWikiInstallationCommonFunction extends PHPUnit_Extensions_SeleniumTestCase {
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 399ed4e..16d065c 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index f57c1a5..4ca6916 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index 4c05266..7a1b615 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 
 /**
index b9ca830..ea87de0 100644 (file)
@@ -29,7 +29,7 @@
 
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index 700172c..7b0fcf3 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
index eb82071..5cdc8d4 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -114,4 +114,4 @@ class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationComm
         $this->chooseCancelOnNextConfirmation();
         parent::restartInstallation();
     }
-}
\ No newline at end of file
+}
index 0994892..15fad95 100644 (file)
@@ -27,7 +27,7 @@
  *
  */
 
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
 
 /**
  * Test Case ID   : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
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..8307b48 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
@@ -71,9 +71,10 @@ function wfThumbHandle404() {
        }
        # Just get the URI path (REDIRECT_URL/REQUEST_URI is either a full URL or a path)
        if ( substr( $uriPath, 0, 1 ) !== '/' ) {
-               $uri = new Uri( $uriPath );
-               $uriPath = $uri->getPath();
-               if ( $uriPath === null ) {
+               $bits = wfParseUrl( $uriPath );
+               if ( $bits && isset( $bits['path'] ) ) {
+                       $uriPath = $bits['path'];
+               } else {
                        wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
                        return;
                }
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' );