X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Fcache%2FLinkCache.php;h=2d088952b656cc25da4bed240265d51e736fc7c2;hb=bed43f525501ddf80995daa8e406414500ce3d1d;hp=23cc26d5e23bb3cb6842ada788dfac3f2001e7d1;hpb=1e3c2e5904d628c001a8d65909b135ea9bf042aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/LinkCache.php b/includes/cache/LinkCache.php index 23cc26d5e2..2d088952b6 100644 --- a/includes/cache/LinkCache.php +++ b/includes/cache/LinkCache.php @@ -20,6 +20,9 @@ * @file * @ingroup Cache */ + +use Wikimedia\Rdbms\Database; +use Wikimedia\Rdbms\IDatabase; use MediaWiki\Linker\LinkTarget; use MediaWiki\MediaWikiServices; @@ -278,6 +281,20 @@ class LinkCache { return $id; } + /** + * @param WANObjectCache $cache + * @param TitleValue $t + * @return string[] + * @since 1.28 + */ + public function getMutableCacheKeys( WANObjectCache $cache, TitleValue $t ) { + if ( $this->isCacheable( $t ) ) { + return [ $cache->makeKey( 'page', $t->getNamespace(), sha1( $t->getDBkey() ) ) ]; + } + + return []; + } + private function isCacheable( LinkTarget $title ) { return ( $title->inNamespace( NS_TEMPLATE ) || $title->inNamespace( NS_FILE ) ); }