MediaWiki
REL1_22
|
Prioritized list of file repositories. More...
Public Member Functions | |
__construct ($localInfo, $foreignInfo) | |
Construct a group of file repositories. | |
checkRedirect (Title $title) | |
Interface for FileRepo::checkRedirect() | |
clearCache (Title $title=null) | |
Clear RepoGroup process cache used for finding a file. | |
findBySha1 ($hash) | |
Find all instances of files with this key. | |
findBySha1s (array $hashes) | |
Find all instances of files with this keys. | |
findFile ($title, $options=array()) | |
Search repositories for an image. | |
findFileFromKey ($hash, $options=array()) | |
Find an instance of the file with this key, created at the specified time Returns false if the file does not exist. | |
findFiles ($inputItems) | |
forEachForeignRepo ($callback, $params=array()) | |
Call a function for each foreign repo, with the repo object as the first parameter. | |
getFileProps ($fileName) | |
getLocalRepo () | |
Get the local repository, i.e. | |
getRepo ($index) | |
Get the repo instance with a given key. | |
getRepoByName ($name) | |
Get the repo instance by its name. | |
hasForeignRepos () | |
Does the installation have any foreign repos set up? | |
initialiseRepos () | |
Initialise the $repos array. | |
splitVirtualUrl ($url) | |
Split a virtual URL into repo, zone and rel parts. | |
Static Public Member Functions | |
static | destroySingleton () |
Destroy the singleton instance, so that a new one will be created next time singleton() is called. | |
static | setSingleton ($instance) |
Set the singleton instance to a given object Used by extensions which hook into the Repo chain. | |
static | singleton () |
Get a RepoGroup instance. | |
Public Attributes | |
$cache | |
$foreignInfo | |
$foreignRepos | |
$localInfo | |
LocalRepo | $localRepo |
$reposInitialised = false | |
const | MAX_CACHE_SIZE = 500 |
Protected Member Functions | |
newRepo ($info) | |
Create a repo class based on an info structure. | |
pingCache ($key) | |
Move a cache entry to the top (such as when accessed) | |
trimCache () | |
Limit cache memory. | |
Static Protected Attributes | |
static | $instance |
Prioritized list of file repositories.
Definition at line 29 of file RepoGroup.php.
RepoGroup::__construct | ( | $ | localInfo, |
$ | foreignInfo | ||
) |
Construct a group of file repositories.
array | $localInfo | Associative array for local repo's info |
array | $foreignInfo | of repository info arrays. Each info array is an associative array with the 'class' member giving the class name. The entire array is passed to the repository constructor as the first parameter. |
Definition at line 87 of file RepoGroup.php.
RepoGroup::checkRedirect | ( | Title $ | title | ) |
Interface for FileRepo::checkRedirect()
$title | Title |
Definition at line 205 of file RepoGroup.php.
RepoGroup::clearCache | ( | Title $ | title = null | ) |
Clear RepoGroup process cache used for finding a file.
$title | Title|null Title of the file or null to clear all files |
Definition at line 446 of file RepoGroup.php.
static RepoGroup::destroySingleton | ( | ) | [static] |
Destroy the singleton instance, so that a new one will be created next time singleton() is called.
Definition at line 62 of file RepoGroup.php.
Referenced by UploadFromUrlTestSuite\setUp(), NewParserTest\setupGlobals(), UploadFromUrlTestSuite\tearDown(), and NewParserTest\tearDown().
RepoGroup::findBySha1 | ( | $ | hash | ) |
Find all instances of files with this key.
string | $hash | base 36 SHA-1 hash |
Definition at line 254 of file RepoGroup.php.
RepoGroup::findBySha1s | ( | array $ | hashes | ) |
Find all instances of files with this keys.
array | $hashes | base 36 SHA-1 hashes |
Definition at line 273 of file RepoGroup.php.
RepoGroup::findFile | ( | $ | title, |
$ | options = array() |
||
) |
Search repositories for an image.
You can also use wfFindFile() to do this.
$title | Title|string Title object or string | |
array | $options | Associative array of options: time: requested time for an archived image, or false for the current version. An image object will be returned which was created at the specified time. |
ignoreRedirect: If true, do not follow file redirects
private: If true, return restricted (deleted) files if the current user is allowed to view them. Otherwise, such files will not be found.
bypassCache: If true, do not use the process-local cache of File objects
Definition at line 112 of file RepoGroup.php.
RepoGroup::findFileFromKey | ( | $ | hash, |
$ | options = array() |
||
) |
Find an instance of the file with this key, created at the specified time Returns false if the file does not exist.
string | $hash | base 36 SHA-1 hash |
array | $options | Option array, same as findFile() |
Definition at line 231 of file RepoGroup.php.
RepoGroup::findFiles | ( | $ | inputItems | ) |
RepoGroup::forEachForeignRepo | ( | $ | callback, |
$ | params = array() |
||
) |
Call a function for each foreign repo, with the repo object as the first parameter.
$callback | Callback: the function to call | |
array | $params | optional additional parameters to pass to the function |
Definition at line 342 of file RepoGroup.php.
RepoGroup::getFileProps | ( | $ | fileName | ) |
Get the local repository, i.e.
the one corresponding to the local image table. Files are typically uploaded to the local repository.
Definition at line 330 of file RepoGroup.php.
RepoGroup::getRepo | ( | $ | index | ) |
Get the repo instance with a given key.
$index | string|int |
Definition at line 294 of file RepoGroup.php.
RepoGroup::getRepoByName | ( | $ | name | ) |
Get the repo instance by its name.
$name | string |
Definition at line 312 of file RepoGroup.php.
Does the installation have any foreign repos set up?
Definition at line 356 of file RepoGroup.php.
Initialise the $repos array.
Definition at line 363 of file RepoGroup.php.
RepoGroup::newRepo | ( | $ | info | ) | [protected] |
Create a repo class based on an info structure.
Definition at line 379 of file RepoGroup.php.
RepoGroup::pingCache | ( | $ | key | ) | [protected] |
Move a cache entry to the top (such as when accessed)
Definition at line 422 of file RepoGroup.php.
static RepoGroup::setSingleton | ( | $ | instance | ) | [static] |
Set the singleton instance to a given object Used by extensions which hook into the Repo chain.
It's not enough to just create a superclass ... you have to get people to call into it even though all they know is RepoGroup::singleton()
$instance | RepoGroup |
Definition at line 74 of file RepoGroup.php.
static RepoGroup::singleton | ( | ) | [static] |
Get a RepoGroup instance.
At present only one instance of RepoGroup is needed in a MediaWiki invocation, this may change in the future.
Definition at line 49 of file RepoGroup.php.
Referenced by ApiQueryAllImages\__construct(), UploadFromChunks\__construct(), UploadFromStash\__construct(), SpecialUploadStash\__construct(), RevDel_FileItem\__construct(), RevertFileAction\checkCanExecute(), UploadBase\checkWarnings(), ApiDelete\deleteFile(), ApiTestCaseUpload\deleteFileByContent(), NewParserTest\deleteFiles(), DeleteArchivedFilesImplementation\doDelete(), RevDel_FileList\doPreCommitUpdates(), MovePageForm\doSubmit(), ApiMove\execute(), ApiQueryStashImageInfo\execute(), CheckImages\execute(), UploadStashCleanup\execute(), RefreshFileHeaders\execute(), ApiQueryImageInfo\execute(), RefreshImageMetadata\execute(), ImageCleanup\filePath(), ImageListPager\formatValue(), ApiQueryFileRepoInfo\getInitialisedRepoGroup(), UploadBase\getRealPath(), Linker\makeBrokenImageLinkObj(), Title\moveTo(), ApiQueryDuplicateFiles\run(), EraseArchivedFile\scrubVersion(), NewParserTest\setupUploads(), SpecialUndelete\showFile(), UploadBase\stashFile(), NewParserTest\teardownUploads(), UploadStashTest\testBug29408(), SpecialUploadStash\tryClearStashedUploads(), SpecialRevisionDelete\tryShowFile(), wfExtractThumbRequestInfo(), wfFindFile(), wfIsBadImage(), wfLocalFile(), wfStreamThumb(), and wfThumbHandle404().
RepoGroup::splitVirtualUrl | ( | $ | url | ) |
Split a virtual URL into repo, zone and rel parts.
$url | string |
MWException |
Definition at line 390 of file RepoGroup.php.
RepoGroup::trimCache | ( | ) | [protected] |
Limit cache memory.
Definition at line 433 of file RepoGroup.php.
RepoGroup::$cache |
Definition at line 36 of file RepoGroup.php.
RepoGroup::$foreignInfo |
Definition at line 35 of file RepoGroup.php.
RepoGroup::$foreignRepos |
Definition at line 34 of file RepoGroup.php.
RepoGroup::$instance [static, protected] |
Definition at line 41 of file RepoGroup.php.
RepoGroup::$localInfo |
Definition at line 35 of file RepoGroup.php.
LocalRepo RepoGroup::$localRepo |
Definition at line 32 of file RepoGroup.php.
RepoGroup::$reposInitialised = false |
Definition at line 34 of file RepoGroup.php.
const RepoGroup::MAX_CACHE_SIZE = 500 |
Definition at line 42 of file RepoGroup.php.