Merge "Move LoadMonitor to Rdbms namespace"
[lhc/web/wiklou.git] / includes / filerepo / file / LocalFile.php
index 16fe72d..8c088b9 100644 (file)
@@ -240,6 +240,15 @@ class LocalFile extends File {
                return $this->repo->getSharedCacheKey( 'file', sha1( $this->getName() ) );
        }
 
+       /**
+        * @param WANObjectCache $cache
+        * @return string[]
+        * @since 1.28
+        */
+       public function getMutableCacheKeys( WANObjectCache $cache ) {
+               return [ $this->getCacheKey() ];
+       }
+
        /**
         * Try to load file metadata from memcached, falling back to the database
         */
@@ -1061,7 +1070,9 @@ class LocalFile extends File {
                $opts['ORDER BY'] = "oi_timestamp $order";
                $opts['USE INDEX'] = [ 'oldimage' => 'oi_name_timestamp' ];
 
-               Hooks::run( 'LocalFile::getHistory', [ &$this, &$tables, &$fields,
+               // Avoid PHP 7.1 warning from passing $this by reference
+               $localFile = $this;
+               Hooks::run( 'LocalFile::getHistory', [ &$localFile, &$tables, &$fields,
                        &$conds, &$opts, &$join_conds ] );
 
                $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds );