Merge "mw.widgets.DateTimeInputWidget: Simplify code for hiding reused $input when...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 8 Oct 2016 23:21:33 +0000 (23:21 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 8 Oct 2016 23:21:33 +0000 (23:21 +0000)
13 files changed:
FAQ
HISTORY
INSTALL
README
docs/README
docs/hooks.txt
includes/EditPage.php
includes/WatchedItemQueryService.php
includes/libs/rdbms/loadmonitor/LoadMonitor.php
includes/page/WikiPage.php
languages/i18n/en.json
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/WatchedItemQueryServiceUnitTest.php

diff --git a/FAQ b/FAQ
index cfacf14..29017bc 100644 (file)
--- a/FAQ
+++ b/FAQ
@@ -1,2 +1,2 @@
 The MediaWiki FAQ can be found at:
-https://www.mediawiki.org/wiki/Manual:FAQ
+https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ
\ No newline at end of file
diff --git a/HISTORY b/HISTORY
index 868b21a..6de7de4 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -1001,8 +1001,8 @@ This is a bug fix release of the MediaWiki 1.25 branch.
 * Added a new hook, "ContentAlterParserOutput", to allow extensions to modify the
   parser output for a content object before links update.
 * (T37785) Enhanced recent changes and extended watchlist are now default.
-  Documentation: https://meta.wikimedia.org/wiki/Help:Enhanced_recent_changes
-  and https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions.
+  Documentation: https://meta.wikimedia.org/wiki/Special:MyLanguage/Help:Enhanced_recent_changes
+  and https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:$wgDefaultUserOptions.
 * (T69341) SVG images will no longer be base64-encoded when being embedded
   in CSS. This results in slight size increase before gzip compression (due to
   percent-encoding), but up to 20% decrease after it.
@@ -1014,7 +1014,7 @@ This is a bug fix release of the MediaWiki 1.25 branch.
   - Basic wikitext syntax: <indicator name="foo">[[File:Foo.svg|20px]]</indicator>
   - Usage instructions: https://www.mediawiki.org/wiki/Help:Page_status_indicators
   - Adjusting custom skins to support indicators:
-    https://www.mediawiki.org/wiki/Manual:Skinning#Page_status_indicators
+    https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Skinning#Page_status_indicators
 * Edit tokens may now be time-limited: passing a maximum age to
   User::matchEditToken will reject any older tokens.
 * The debug logging internals have been overhauled, and are now using the
@@ -1087,7 +1087,7 @@ This is a bug fix release of the MediaWiki 1.25 branch.
    This library provides the interfaces set by the PSR-3 standard (http://www.php-fig.org/psr/psr-3/)
    which are used by MediaWiki internally via the
    MediaWiki\Logger\LoggerFactory class.
-   See the structured logging RfC (https://www.mediawiki.org/wiki/Requests_for_comment/Structured_logging)
+   See the structured logging RfC (https://www.mediawiki.org/wiki/Special:MyLanguage/Requests_for_comment/Structured_logging)
    for more background information.
 ** cssjanus/cssjanus
    This library was formerly bundled with MediaWiki core and has been removed.
@@ -1098,7 +1098,7 @@ This is a bug fix release of the MediaWiki 1.25 branch.
 ** wikimedia/cdb
    This library was formerly a part of MediaWiki core, and has been moved into a separate library.
    It provides CDB functions which are used in the Interwiki and Localization caches.
-   More information about the library can be found at https://www.mediawiki.org/wiki/CDB.
+   More information about the library can be found at https://www.mediawiki.org/wiki/Special:MyLanguage/CDB.
 ** liuggio/statsd-php-client
    This library provides a StatsD client API for logging application metrics to a remote server.
 
diff --git a/INSTALL b/INSTALL
index 0e8eb92..90da381 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -21,7 +21,7 @@ If your PHP is configured as a CGI plug-in rather than an Apache module you may
 experience problems, as this configuration is not well tested.
 
 Support for rendering mathematical formulas requires installing the Math extension,
-see https://www.mediawiki.org/wiki/Extension:Math
+see https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Math
 
 Don't forget to check the RELEASE-NOTES file...
 
@@ -30,7 +30,7 @@ Additional documentation is available online, which may include more detailed
 notes on particular operating systems and workarounds for difficult hosting
 environments:
 
-https://www.mediawiki.org/wiki/Manual:Installation_guide
+https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Installation_guide
 
 
 ******************* WARNING *******************
diff --git a/README b/README
index 6352e62..6d3ab80 100644 (file)
--- a/README
+++ b/README
@@ -17,15 +17,15 @@ For system requirements, installation, and upgrade details, see the files
 RELEASE-NOTES, INSTALL, and UPGRADE.
 
 * Ready to get started?
-** https://www.mediawiki.org/wiki/Download
+** https://www.mediawiki.org/wiki/Special:MyLanguage/Download
 * Looking for the technical manual?
-** https://www.mediawiki.org/wiki/Manual:Contents
+** https://www.mediawiki.org/wiki/Special:MyLangyage/Manual:Contents
 * Seeking help from a person?
-** https://www.mediawiki.org/wiki/Communication
+** https://www.mediawiki.org/wiki/Special:MyLanguage/Communication
 * Looking to file a bug report or a feature request?
 ** https://bugs.mediawiki.org/
 * Interested in helping out?
-** https://www.mediawiki.org/wiki/How_to_contribute
+** https://www.mediawiki.org/wiki/Special:MyLanguage/How_to_contribute
 
 MediaWiki is the result of global collaboration and cooperation. The CREDITS
 file lists technical contributors to the project. The COPYING file explains
index 6f3da97..2d82270 100644 (file)
@@ -4,8 +4,8 @@
 The 'docs' directory contain various text files that should help you understand
 the most important parts of the code of MediaWiki. More in-depth documentation
 can be found at:
-  https://www.mediawiki.org/wiki/Manual:Code
-  https://www.mediawiki.org/wiki/Developer_hub
+  https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Code
+  https://www.mediawiki.org/wiki/Special:MyLanguage/Developer_hub
 API documentation is automatically generated and updated daily at:
   https://doc.wikimedia.org/mediawiki-core/master/php/html/
 
@@ -14,6 +14,6 @@ You can get a fresh version using 'make doc' or mwdocgen.php in the
 
 
 For end users, most of the documentation is located online at:
-  https://www.mediawiki.org/wiki/Help:Contents
+  https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents
 Documentation for MediaWiki site administrators is at:
-  https://www.mediawiki.org/wiki/Manual:Contents
+  https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents
index cccd13d..3b3741a 100644 (file)
@@ -1243,7 +1243,7 @@ $out: OutputPage object
 $parserOutput: ParserOutput object
 $wikiPage: WikiPage object
 
-DifferenceEngineRenderRevisionShowFinalPatrolLink': An extension can hook into this hook
+'DifferenceEngineRenderRevisionShowFinalPatrolLink': An extension can hook into this hook
 point and return false to not show the final "mark as patrolled" link on the bottom
 of a page.
 This hook has no arguments.
index 8ca7105..8226da5 100644 (file)
@@ -3300,17 +3300,28 @@ HTML
                        'id' => $name,
                        'cols' => $wgUser->getIntOption( 'cols' ),
                        'rows' => $wgUser->getIntOption( 'rows' ),
-                       // The following classes can be used here:
-                       // * mw-editfont-default
-                       // * mw-editfont-monospace
-                       // * mw-editfont-sans-serif
-                       // * mw-editfont-serif
-                       'class' => 'mw-editfont-' . $wgUser->getOption( 'editfont' ),
                        // Avoid PHP notices when appending preferences
                        // (appending allows customAttribs['style'] to still work).
                        'style' => ''
                ];
 
+               // The following classes can be used here:
+               // * mw-editfont-default
+               // * mw-editfont-monospace
+               // * mw-editfont-sans-serif
+               // * mw-editfont-serif
+               $class = 'mw-editfont-' . $wgUser->getOption( 'editfont' );
+
+               if ( isset( $attribs['class'] ) ) {
+                       if ( is_string( $attribs['class'] ) ) {
+                               $attribs['class'] .= ' ' . $class;
+                       } elseif ( is_array( $attribs['class'] ) ) {
+                               $attribs['class'][] = $class;
+                       }
+               } else {
+                       $attribs['class'] = $class;
+               }
+
                $pageLang = $this->mTitle->getPageLanguage();
                $attribs['lang'] = $pageLang->getHtmlCode();
                $attribs['dir'] = $pageLang->getDir();
index 4802f72..8497224 100644 (file)
@@ -55,19 +55,11 @@ class WatchedItemQueryService {
        }
 
        /**
-        * @return Database
+        * @return IDatabase
         * @throws MWException
         */
        private function getConnection() {
-               return $this->loadBalancer->getConnection( DB_REPLICA, [ 'watchlist' ] );
-       }
-
-       /**
-        * @param Database $connection
-        * @throws MWException
-        */
-       private function reuseConnection( Database $connection ) {
-               $this->loadBalancer->reuseConnection( $connection );
+               return $this->loadBalancer->getConnectionRef( DB_REPLICA, [ 'watchlist' ] );
        }
 
        /**
@@ -181,8 +173,6 @@ class WatchedItemQueryService {
                        $joinConds
                );
 
-               $this->reuseConnection( $db );
-
                $items = [];
                foreach ( $res as $row ) {
                        $items[] = [
@@ -258,8 +248,6 @@ class WatchedItemQueryService {
                        $dbOptions
                );
 
-               $this->reuseConnection( $db );
-
                $watchedItems = [];
                foreach ( $res as $row ) {
                        // todo these could all be cached at some point?
@@ -337,7 +325,7 @@ class WatchedItemQueryService {
        }
 
        private function getWatchedItemsWithRCInfoQueryConds(
-               Database $db,
+               IDatabase $db,
                User $user,
                array $options
        ) {
@@ -445,7 +433,7 @@ class WatchedItemQueryService {
                return $conds;
        }
 
-       private function getStartEndConds( Database $db, array $options ) {
+       private function getStartEndConds( IDatabase $db, array $options ) {
                if ( !isset( $options['start'] ) && ! isset( $options['end'] ) ) {
                        return [];
                }
@@ -464,7 +452,7 @@ class WatchedItemQueryService {
                return $conds;
        }
 
-       private function getUserRelatedConds( Database $db, User $user, array $options ) {
+       private function getUserRelatedConds( IDatabase $db, User $user, array $options ) {
                if ( !array_key_exists( 'onlyByUser', $options ) && !array_key_exists( 'notByUser', $options ) ) {
                        return [];
                }
@@ -491,7 +479,7 @@ class WatchedItemQueryService {
                return $conds;
        }
 
-       private function getExtraDeletedPageLogEntryRelatedCond( Database $db, User $user ) {
+       private function getExtraDeletedPageLogEntryRelatedCond( IDatabase $db, User $user ) {
                // LogPage::DELETED_ACTION hides the affected page, too. So hide those
                // entirely from the watchlist, or someone could guess the title.
                $bitmask = 0;
@@ -509,7 +497,7 @@ class WatchedItemQueryService {
                return '';
        }
 
-       private function getStartFromConds( Database $db, array $options ) {
+       private function getStartFromConds( IDatabase $db, array $options ) {
                $op = $options['dir'] === self::DIR_OLDER ? '<' : '>';
                list( $rcTimestamp, $rcId ) = $options['startFrom'];
                $rcTimestamp = $db->addQuotes( $db->timestamp( $rcTimestamp ) );
@@ -529,7 +517,7 @@ class WatchedItemQueryService {
                );
        }
 
-       private function getWatchedItemsForUserQueryConds( Database $db, User $user, array $options ) {
+       private function getWatchedItemsForUserQueryConds( IDatabase $db, User $user, array $options ) {
                $conds = [ 'wl_user' => $user->getId() ];
                if ( $options['namespaceIds'] ) {
                        $conds['wl_namespace'] = array_map( 'intval', $options['namespaceIds'] );
@@ -563,12 +551,12 @@ class WatchedItemQueryService {
         * Creates a query condition part for getting only items before or after the given link target
         * (while ordering using $sort mode)
         *
-        * @param Database $db
+        * @param IDatabase $db
         * @param LinkTarget $target
         * @param string $op comparison operator to use in the conditions
         * @return string
         */
-       private function getFromUntilTargetConds( Database $db, LinkTarget $target, $op ) {
+       private function getFromUntilTargetConds( IDatabase $db, LinkTarget $target, $op ) {
                return $db->makeList(
                        [
                                "wl_namespace $op " . $target->getNamespace(),
index 499542d..99c9126 100644 (file)
@@ -160,10 +160,14 @@ class LoadMonitor implements ILoadMonitor {
                                continue;
                        }
 
-                       $lagTimes[$i] = $conn->getLag();
-                       if ( $lagTimes[$i] === false ) {
-                               $host = $this->parent->getServerName( $i );
-                               $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+                       if ( $conn->getLBInfo( 'is static' ) ) {
+                               $lagTimes[$i] = 0;
+                       } else {
+                               $lagTimes[$i] = $conn->getLag();
+                               if ( $lagTimes[$i] === false ) {
+                                       $host = $this->parent->getServerName( $i );
+                                       $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+                               }
                        }
 
                        if ( $close ) {
index 2833965..c791587 100644 (file)
@@ -2075,7 +2075,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @return object
         */
        public function prepareTextForEdit( $text, $revid = null, User $user = null ) {
-               ContentHandler::deprecated( __METHOD__, '1.21' );
+               wfDeprecated( __METHOD__, '1.21' );
                $content = ContentHandler::makeContent( $text, $this->getTitle() );
                return $this->prepareContentForEdit( $content, $revid, $user );
        }
index 3136f05..d10749d 100644 (file)
        "category-file-count-limited": "The following {{PLURAL:$1|file is|$1 files are}} in the current category.",
        "listingcontinuesabbrev": "cont.",
        "index-category": "Indexed pages",
-       "noindex-category": "Non-indexed pages",
+       "noindex-category": "Noindexed pages",
        "broken-file-category": "Pages with broken file links",
        "categoryviewer-pagedlinks": "($1) ($2)",
        "category-header-numerals": "$1–$2",
index e53a958..9599016 100644 (file)
@@ -242,7 +242,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                 * which we can't allow, as that would open a new connection for mysql.
                 * Replace with a HashBag. They would not be going to persist anyway.
                 */
-               $hashCache = [ 'class' => 'HashBagOStuff' ];
+               $hashCache = [ 'class' => 'HashBagOStuff', 'reportDupes' => false ];
                $objectCaches = [
                                CACHE_DB => $hashCache,
                                CACHE_ACCEL => $hashCache,
index 93e0b57..92446ed 100644 (file)
@@ -55,7 +55,7 @@ class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $mock->expects( $this->any() )
-                       ->method( 'getConnection' )
+                       ->method( 'getConnectionRef' )
                        ->with( DB_SLAVE )
                        ->will( $this->returnValue( $mockDb ) );
                return $mock;