Start working on phan-taint-check warnings. Fix minor escaping issues.
[lhc/web/wiklou.git] / includes / cache / LinkCache.php
index 57f66f1..58ed771 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  * @ingroup Cache
  */
+
+use Wikimedia\Rdbms\Database;
 use Wikimedia\Rdbms\IDatabase;
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
@@ -73,7 +75,7 @@ class LinkCache {
         * in order to avoid link table inconsistency), which was later removed
         * for performance on wikis with a high edit rate.
         *
-        * @param bool $update
+        * @param bool|null $update
         * @return bool
         */
        public function forUpdate( $update = null ) {
@@ -123,7 +125,7 @@ class LinkCache {
         * @param int $id Page's ID
         * @param LinkTarget $target
         * @param int $len Text's length
-        * @param int $redir Whether the page is a redirect
+        * @param int|null $redir Whether the page is a redirect
         * @param int $revision Latest revision's ID
         * @param string|null $model Latest revision's content model ID
         * @param string|null $lang Language code of the page, if not the content language
@@ -319,7 +321,7 @@ class LinkCache {
         */
        public function invalidateTitle( LinkTarget $title ) {
                if ( $this->isCacheable( $title ) ) {
-                       $cache = ObjectCache::getMainWANInstance();
+                       $cache = $this->wanCache;
                        $cache->delete(
                                $cache->makeKey( 'page', $title->getNamespace(), sha1( $title->getDBkey() ) )
                        );