Inherits FSRepo.
Inherited by ForeignDBRepo, and ForeignDBViaLBRepo.
Public Member Functions | |
newFileFromRow ($row) | |
newFromArchiveName ($title, $archiveName) | |
cleanupDeletedBatch ($storageKeys) | |
Delete files in the deleted directory if they are not referenced in the filearchive table. | |
checkRedirect ($title) | |
Checks if there is a redirect named as $title. | |
findBySha1 ($hash) | |
Get an array or iterator of file objects for files that have a given SHA-1 content hash. | |
getSlaveDB () | |
Get a connection to the slave DB. | |
getMasterDB () | |
Get a connection to the master DB. | |
getSharedCacheKey () | |
Get a key on the primary cache for this repository. | |
invalidateImageRedirect ($title) | |
Invalidates image redirect cache related to that image. | |
Public Attributes | |
$fileFactory = array( 'LocalFile', 'newFromTitle' ) | |
Factory functions for creating new files Override these in the base class. | |
$oldFileFactory = array( 'OldLocalFile', 'newFromTitle' ) | |
$fileFromRowFactory = array( 'LocalFile', 'newFromRow' ) | |
$oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ) | |
Protected Member Functions | |
getArticleID ($title) | |
Function link Title::getArticleID(). |
This is the most commonly used repository class.
Definition at line 7 of file LocalRepo.php.
LocalRepo::checkRedirect | ( | $ | title | ) |
Checks if there is a redirect named as $title.
Reimplemented from FileRepo.
Definition at line 76 of file LocalRepo.php.
References $dbr, $title, $wgMemc, getArticleID(), FileRepo::getLocalCacheKey(), getSharedCacheKey(), getSlaveDB(), Title::makeTitle(), and Title::newFromText().
LocalRepo::cleanupDeletedBatch | ( | $ | storageKeys | ) |
Delete files in the deleted directory if they are not referenced in the filearchive table.
This needs to be done in the repo because it needs to interleave database locks with file operations, which is potentially a remote operation.
Reimplemented from FileRepo.
Definition at line 34 of file LocalRepo.php.
References $dbw, $ext, $path, File::DELETED_FILE, FSRepo::getDeletedHashPath(), getMasterDB(), FSRepo::getZonePath(), FileRepo::newGood(), File::normalizeExtension(), and wfDebug().
LocalRepo::findBySha1 | ( | $ | hash | ) |
Get an array or iterator of file objects for files that have a given SHA-1 content hash.
Reimplemented from FileRepo.
Definition at line 150 of file LocalRepo.php.
References $dbr, $res, $result, getSlaveDB(), newFileFromRow(), and LocalFile::selectFields().
LocalRepo::getArticleID | ( | $ | title | ) | [protected] |
Function link Title::getArticleID().
We can't say Title object, what database it should use, so we duplicate that function here.
Definition at line 129 of file LocalRepo.php.
References $dbr, $title, and getSlaveDB().
Referenced by checkRedirect().
LocalRepo::getMasterDB | ( | ) |
Get a connection to the master DB.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 175 of file LocalRepo.php.
References wfGetDB().
Referenced by cleanupDeletedBatch().
LocalRepo::getSharedCacheKey | ( | ) |
Get a key on the primary cache for this repository.
Returns false if the repository's cache is not accessible at this site. The parameters are the parts of the key, as for wfMemcKey().
Reimplemented from FileRepo.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 184 of file LocalRepo.php.
Referenced by checkRedirect(), and invalidateImageRedirect().
LocalRepo::getSlaveDB | ( | ) |
Get a connection to the slave DB.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 168 of file LocalRepo.php.
References wfGetDB().
Referenced by checkRedirect(), findBySha1(), and getArticleID().
LocalRepo::invalidateImageRedirect | ( | $ | title | ) |
Invalidates image redirect cache related to that image.
Reimplemented from FileRepo.
Definition at line 194 of file LocalRepo.php.
References $title, $wgMemc, and getSharedCacheKey().
LocalRepo::newFileFromRow | ( | $ | row | ) |
LocalRepo::newFromArchiveName | ( | $ | title, | |
$ | archiveName | |||
) |
LocalRepo::$fileFactory = array( 'LocalFile', 'newFromTitle' ) |
Factory functions for creating new files Override these in the base class.
Reimplemented from FSRepo.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 8 of file LocalRepo.php.
LocalRepo::$fileFromRowFactory = array( 'LocalFile', 'newFromRow' ) |
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 10 of file LocalRepo.php.
LocalRepo::$oldFileFactory = array( 'OldLocalFile', 'newFromTitle' ) |
LocalRepo::$oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ) |
Definition at line 11 of file LocalRepo.php.