Merge "rdbms: remove obsolete getReplicaPos() code"
[lhc/web/wiklou.git] / includes / cache / MessageCache.php
index ad1fffb..63c03af 100644 (file)
@@ -156,22 +156,22 @@ class MessageCache {
        }
 
        /**
-        * @param WANObjectCache $wanCache WAN cache instance
-        * @param BagOStuff $clusterCache Cluster cache instance
-        * @param BagOStuff $srvCache Server cache instance
+        * @param WANObjectCache $wanCache
+        * @param BagOStuff $clusterCache
+        * @param BagOStuff $serverCache
         * @param bool $useDB Whether to look for message overrides (e.g. MediaWiki: pages)
         * @param int $expiry Lifetime for cache. @see $mExpiry.
         */
        public function __construct(
                WANObjectCache $wanCache,
                BagOStuff $clusterCache,
-               BagOStuff $srvCache,
+               BagOStuff $serverCache,
                $useDB,
                $expiry
        ) {
                $this->wanCache = $wanCache;
                $this->clusterCache = $clusterCache;
-               $this->srvCache = $srvCache;
+               $this->srvCache = $serverCache;
 
                $this->mDisable = !$useDB;
                $this->mExpiry = $expiry;
@@ -193,7 +193,6 @@ class MessageCache {
                                $po = ParserOptions::newFromAnon();
                                $po->setEditSection( false );
                                $po->setAllowUnsafeRawHtml( false );
-                               $po->setWrapOutputClass( false );
                                return $po;
                        }
 
@@ -203,11 +202,6 @@ class MessageCache {
                        // from malicious sources. As a precaution, disable
                        // the <html> parser tag when parsing messages.
                        $this->mParserOptions->setAllowUnsafeRawHtml( false );
-                       // Wrapping messages in an extra <div> is probably not expected. If
-                       // they're outside the content area they probably shouldn't be
-                       // targeted by CSS that's targeting the parser output, and if
-                       // they're inside they already are from the outer div.
-                       $this->mParserOptions->setWrapOutputClass( false );
                }
 
                return $this->mParserOptions;
@@ -253,7 +247,7 @@ class MessageCache {
         * is disabled.
         *
         * @param string $code Language to which load messages
-        * @param integer $mode Use MessageCache::FOR_UPDATE to skip process cache [optional]
+        * @param int $mode Use MessageCache::FOR_UPDATE to skip process cache [optional]
         * @throws MWException
         * @return bool
         */
@@ -395,8 +389,8 @@ class MessageCache {
 
        /**
         * @param string $code
-        * @param array $where List of wfDebug() comments
-        * @param integer $mode Use MessageCache::FOR_UPDATE to use DB_MASTER
+        * @param array &$where List of wfDebug() comments
+        * @param int $mode Use MessageCache::FOR_UPDATE to use DB_MASTER
         * @return bool|string True on success or one of ("cantacquire", "disabled")
         */
        protected function loadFromDBWithLock( $code, array &$where, $mode = null ) {
@@ -458,7 +452,7 @@ class MessageCache {
         * on-demand from the database later.
         *
         * @param string $code Language code
-        * @param integer $mode Use MessageCache::FOR_UPDATE to skip process cache
+        * @param int $mode Use MessageCache::FOR_UPDATE to skip process cache
         * @return array Loaded messages for storing in caches
         */
        protected function loadFromDB( $code, $mode = null ) {
@@ -755,7 +749,7 @@ class MessageCache {
 
        /**
         * @param string $key A language message cache key that stores blobs
-        * @param integer $timeout Wait timeout in seconds
+        * @param int $timeout Wait timeout in seconds
         * @return null|ScopedCallback
         */
        protected function getReentrantScopedLock( $key, $timeout = self::WAIT_SEC ) {
@@ -816,7 +810,7 @@ class MessageCache {
                }
 
                // Normalise title-case input (with some inlining)
-               $lckey = MessageCache::normalizeKey( $key );
+               $lckey = self::normalizeKey( $key );
 
                Hooks::run( 'MessageCache::get', [ &$lckey ] );
 
@@ -1048,8 +1042,7 @@ class MessageCache {
                if ( $titleObj->getLatestRevID() ) {
                        $revision = Revision::newKnownCurrent(
                                $dbr,
-                               $titleObj->getArticleID(),
-                               $titleObj->getLatestRevID()
+                               $titleObj
                        );
                } else {
                        $revision = false;
@@ -1127,7 +1120,7 @@ class MessageCache {
                        $wgParser->firstCallInit();
                        # Clone it and store it
                        $class = $wgParserConf['class'];
-                       if ( $class == 'ParserDiffTest' ) {
+                       if ( $class == ParserDiffTest::class ) {
                                # Uncloneable
                                $this->mParser = new $class( $wgParserConf );
                        } else {