MediaWiki
REL1_24
|
A repository that stores files in the local filesystem and registers them in the wiki's own database. More...
Public Member Functions | |
checkRedirect (Title $title) | |
Checks if there is a redirect named as $title. | |
cleanupDeletedBatch (array $storageKeys) | |
Delete files in the deleted directory if they are not referenced in the filearchive table. | |
findBySha1 ($hash) | |
Get an array or iterator of file objects for files that have a given SHA-1 content hash. | |
findBySha1s (array $hashes) | |
Get an array of arrays or iterators of file objects for files that have the given SHA-1 content hashes. | |
findFiles (array $items, $flags=0) | |
Find many files at once. | |
findFilesByPrefix ($prefix, $limit) | |
Return an array of files where the name starts with $prefix. | |
getInfo () | |
Return information about the repository. | |
getMasterDB () | |
Get a connection to the master DB. | |
getSharedCacheKey () | |
Get a key on the primary cache for this repository. | |
getSlaveDB () | |
Get a connection to the slave DB. | |
invalidateImageRedirect (Title $title) | |
Invalidates image redirect cache related to that image. | |
newFileFromRow ($row) | |
newFromArchiveName ($title, $archiveName) | |
Static Public Member Functions | |
static | getHashFromKey ($key) |
Gets the SHA1 hash from a storage key. | |
Protected Member Functions | |
deletedFileHasKey ($key, $lock=null) | |
Check if a deleted (filearchive) file has this sha1 key. | |
getArticleID ($title) | |
Function link Title::getArticleID(). | |
hiddenFileHasKey ($key, $lock=null) | |
Check if a hidden (revision delete) file has this sha1 key. | |
Protected Attributes | |
array | $fileFactory = array( 'LocalFile', 'newFromTitle' ) |
* | |
array | $fileFactoryKey = array( 'LocalFile', 'newFromKey' ) |
* | |
array | $fileFromRowFactory = array( 'LocalFile', 'newFromRow' ) |
* | |
array | $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' ) |
* | |
array | $oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' ) |
* | |
array | $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ) |
* |
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.
Definition at line 31 of file LocalRepo.php.
LocalRepo::checkRedirect | ( | Title $ | title | ) |
Checks if there is a redirect named as $title.
Reimplemented from FileRepo.
Definition at line 166 of file LocalRepo.php.
LocalRepo::cleanupDeletedBatch | ( | array $ | 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.
array | $storageKeys |
Reimplemented from FileRepo.
Definition at line 78 of file LocalRepo.php.
LocalRepo::deletedFileHasKey | ( | $ | key, |
$ | lock = null |
||
) | [protected] |
Check if a deleted (filearchive) file has this sha1 key.
string | $key | File storage key (base-36 sha1 key with file extension) |
string | null | $lock | Use "lock" to lock the row via FOR UPDATE |
Definition at line 116 of file LocalRepo.php.
LocalRepo::findBySha1 | ( | $ | hash | ) |
Get an array or iterator of file objects for files that have a given SHA-1 content hash.
string | $hash | A sha1 hash to look for |
Reimplemented from FileRepo.
Definition at line 369 of file LocalRepo.php.
LocalRepo::findBySha1s | ( | array $ | hashes | ) |
Get an array of arrays or iterators of file objects for files that have the given SHA-1 content hashes.
Overrides generic implementation in FileRepo for performance reason
array | $hashes | An array of hashes |
Reimplemented from FileRepo.
Definition at line 397 of file LocalRepo.php.
LocalRepo::findFiles | ( | array $ | items, |
$ | flags = 0 |
||
) |
Find many files at once.
array | $items | An array of titles, or an array of findFile() options with the "title" option giving the title. Example: |
$findItem = array( 'title' => $title, 'private' => true ); $findBatch = array( $findItem ); $repo->findFiles( $findBatch );
No title should appear in $items twice, as the result use titles as keys
int | $flags | Supports:
|
Reimplemented from FileRepo.
Definition at line 237 of file LocalRepo.php.
LocalRepo::findFilesByPrefix | ( | $ | prefix, |
$ | limit | ||
) |
Return an array of files where the name starts with $prefix.
string | $prefix | The prefix to search for |
int | $limit | The maximum amount of files to return |
Reimplemented from FileRepo.
Definition at line 428 of file LocalRepo.php.
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.
Title | $title |
Definition at line 219 of file LocalRepo.php.
static LocalRepo::getHashFromKey | ( | $ | key | ) | [static] |
Gets the SHA1 hash from a storage key.
string | $key |
Definition at line 156 of file LocalRepo.php.
Referenced by LocalFileRestoreBatch\addIds(), PopulateFilearchiveSha1\doDBUpdates(), and DeleteArchivedFilesImplementation\doDelete().
Return information about the repository.
Reimplemented from FileRepo.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 503 of file LocalRepo.php.
Get a connection to the master DB.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 462 of file LocalRepo.php.
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 473 of file LocalRepo.php.
Get a connection to the slave DB.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 454 of file LocalRepo.php.
LocalRepo::hiddenFileHasKey | ( | $ | key, |
$ | lock = null |
||
) | [protected] |
Check if a hidden (revision delete) file has this sha1 key.
string | $key | File storage key (base-36 sha1 key with file extension) |
string | null | $lock | Use "lock" to lock the row via FOR UPDATE |
Definition at line 134 of file LocalRepo.php.
LocalRepo::invalidateImageRedirect | ( | Title $ | title | ) |
Invalidates image redirect cache related to that image.
Reimplemented from FileRepo.
Definition at line 485 of file LocalRepo.php.
LocalRepo::newFileFromRow | ( | $ | row | ) |
MWException |
stdClass | $row |
Definition at line 49 of file LocalRepo.php.
LocalRepo::newFromArchiveName | ( | $ | title, |
$ | archiveName | ||
) |
Title | $title | |
string | $archiveName |
Definition at line 64 of file LocalRepo.php.
References $title.
*
Reimplemented from FileRepo.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 32 of file LocalRepo.php.
*
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 36 of file LocalRepo.php.
array LocalRepo::$oldFileFactory = array( 'OldLocalFile', 'newFromTitle' ) [protected] |
array LocalRepo::$oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' ) [protected] |
array LocalRepo::$oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ) [protected] |
*
Definition at line 38 of file LocalRepo.php.