* @file
* @ingroup Cache
*/
+
+use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
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 ) );
}
*/
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() ) )
);