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
*/
$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 );
/**
* Move or copy a file to its public location. If a file exists at the
- * destination, move it to an archive. Returns a FileRepoStatus object with
+ * destination, move it to an archive. Returns a Status object with
* the archive name in the "value" member on success.
*
* The archive name should be passed through to recordUpload for database
}
/**
- * Move or copy a file to a specified location. Returns a FileRepoStatus
+ * Move or copy a file to a specified location. Returns a Status
* object with the archive name in the "value" member on success.
*
* The archive name should be passed through to recordUpload for database
/** @var bool Whether to suppress all suppressable fields when deleting */
private $suppress;
- /** @var FileRepoStatus */
+ /** @var Status */
private $status;
/** @var User */
}
/**
- * Verify the database updates and return a new FileRepoStatus indicating how
+ * Verify the database updates and return a new Status indicating how
* many rows would be updated.
*
* @return Status
}
/**
- * Do the database updates and return a new FileRepoStatus indicating how
+ * Do the database updates and return a new Status indicating how
* many rows where updated.
*/
protected function doDBUpdates() {