* @ingroup FileRepo
*/
+use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
+
/**
* A repository that stores files in the local filesystem and registers them
* in the wiki's own database. This is the most commonly used repository class.
$memcKey,
$expiry,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $method, $title ) {
- $dbr = $this->getSlaveDB(); // possibly remote DB
+ $dbr = $this->getReplicaDB(); // possibly remote DB
$setOpts += Database::getCacheSetOptions( $dbr );
}
};
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
// Query image table
$imgNames = [];
* @return File[]
*/
function findBySha1( $hash ) {
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
$res = $dbr->select(
'image',
LocalFile::selectFields(),
return []; // empty parameter
}
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
$res = $dbr->select(
'image',
LocalFile::selectFields(),
$selectOptions = [ 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) ];
// Query database
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
$res = $dbr->select(
'image',
LocalFile::selectFields(),
* Get a connection to the replica DB
* @return IDatabase
*/
- function getSlaveDB() {
+ function getReplicaDB() {
return wfGetDB( DB_REPLICA );
}
+ /**
+ * Alias for getReplicaDB()
+ *
+ * @return IDatabase
+ * @deprecated Since 1.29
+ */
+ function getSlaveDB() {
+ return $this->getReplicaDB();
+ }
+
/**
* Get a connection to the master DB
* @return IDatabase