Public Member Functions | |
__construct ($localInfo, $foreignInfo) | |
Construct a group of file repositories. | |
findFile ($title, $options=array()) | |
Search repositories for an image. | |
findFiles ($inputItems) | |
checkRedirect ($title) | |
Interface for FileRepo::checkRedirect(). | |
findBySha1 ($hash) | |
getRepo ($index) | |
Get the repo instance with a given key. | |
getRepoByName ($name) | |
Get the repo instance by its name. | |
getLocalRepo () | |
Get the local repository, i.e. | |
forEachForeignRepo ($callback, $params=array()) | |
Call a function for each foreign repo, with the repo object as the first parameter. | |
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. | |
getFileProps ($fileName) | |
trimCache () | |
Limit cache memory. | |
Static Public Member Functions | |
static | singleton () |
Get a RepoGroup instance. | |
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. | |
Public Attributes | |
$localRepo | |
$foreignRepos | |
$reposInitialised = false | |
$localInfo | |
$foreignInfo | |
$cache | |
const | MAX_CACHE_SIZE = 1000 |
Protected Member Functions | |
newRepo ($info) | |
Create a repo class based on an info structure. | |
Static Protected Attributes | |
static | $instance |
Definition at line 13 of file RepoGroup.php.
RepoGroup::__construct | ( | $ | localInfo, | |
$ | foreignInfo | |||
) |
Construct a group of file repositories.
array | $data Array 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 56 of file RepoGroup.php.
References $foreignInfo, and $localInfo.
RepoGroup::checkRedirect | ( | $ | title | ) |
Interface for FileRepo::checkRedirect().
Definition at line 176 of file RepoGroup.php.
References $title, and initialiseRepos().
static RepoGroup::destroySingleton | ( | ) | [static] |
Destroy the singleton instance, so that a new one will be created next time singleton() is called.
Definition at line 38 of file RepoGroup.php.
Referenced by ParserTest::teardownGlobals().
RepoGroup::findBySha1 | ( | $ | hash | ) |
RepoGroup::findFile | ( | $ | title, | |
$ | options = array() | |||
) |
Search repositories for an image.
You can also use wfFindFile() to do this.
mixed | $title Title object or string | |
$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. |
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 80 of file RepoGroup.php.
References $options, $title, initialiseRepos(), Title::makeTitleSafe(), trimCache(), and wfDebug().
RepoGroup::findFiles | ( | $ | inputItems | ) |
Definition at line 144 of file RepoGroup.php.
References $name, initialiseRepos(), and Title::makeTitleSafe().
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 | |
$params | array Optional additional parameters to pass to the function |
Definition at line 249 of file RepoGroup.php.
RepoGroup::getFileProps | ( | $ | fileName | ) |
Definition at line 307 of file RepoGroup.php.
References File::getPropsFromPath(), getRepo(), FileRepo::isVirtualUrl(), and splitVirtualUrl().
RepoGroup::getLocalRepo | ( | ) |
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 238 of file RepoGroup.php.
References getRepo().
RepoGroup::getRepo | ( | $ | index | ) |
Get the repo instance with a given key.
Definition at line 208 of file RepoGroup.php.
References initialiseRepos().
Referenced by getFileProps(), and getLocalRepo().
RepoGroup::getRepoByName | ( | $ | name | ) |
Get the repo instance by its name.
Definition at line 223 of file RepoGroup.php.
References $name, and initialiseRepos().
RepoGroup::hasForeignRepos | ( | ) |
Does the installation have any foreign repos set up?
Definition at line 263 of file RepoGroup.php.
RepoGroup::initialiseRepos | ( | ) |
Initialise the $repos array.
Definition at line 270 of file RepoGroup.php.
References newRepo().
Referenced by checkRedirect(), findBySha1(), findFile(), findFiles(), getRepo(), and getRepoByName().
RepoGroup::newRepo | ( | $ | info | ) | [protected] |
Create a repo class based on an info structure.
Definition at line 286 of file RepoGroup.php.
Referenced by initialiseRepos().
static RepoGroup::setSingleton | ( | $ | instance | ) | [static] |
Set the singleton instance to a given object.
Definition at line 45 of file RepoGroup.php.
References $instance.
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 25 of file RepoGroup.php.
References $wgForeignFileRepos, and $wgLocalFileRepo.
Referenced by RevDel_FileItem::__construct(), Image::__construct(), ApiQueryAllimages::__construct(), UploadBase::checkWarnings(), ImageBuilder::crawlMissing(), ApiDelete::deleteFile(), RevDel_FileList::doPreCommitUpdates(), MovePageForm::doSubmit(), DeleteArchivedFiles::execute(), CheckImages::execute(), LocalFileRestoreBatch::execute(), FileDeleteForm::execute(), ApiQueryImageInfo::execute(), ApiMove::execute(), ImageCleanup::filePath(), ImagePage::getDuplicates(), FileRevertForm::getOldFile(), UploadBase::getRealPath(), ImageBuilder::getRepo(), Linker::makeBrokenImageLinkObj(), Article::onArticleDelete(), UploadBase::saveTempUploadedFile(), UndeleteForm::showFile(), SpecialRevisionDelete::tryShowFile(), UploadFromStash::unsaveUploadedFile(), Article::updateRedirectOn(), wfFindFile(), wfIsBadImage(), wfLocalFile(), and wfThumbMain().
RepoGroup::splitVirtualUrl | ( | $ | url | ) |
Split a virtual URL into repo, zone and rel parts.
Definition at line 295 of file RepoGroup.php.
References $url.
Referenced by getFileProps().
RepoGroup::trimCache | ( | ) |
Limit cache memory.
Definition at line 323 of file RepoGroup.php.
References wfDebug().
Referenced by findFile().
RepoGroup::$cache |
Definition at line 16 of file RepoGroup.php.
RepoGroup::$foreignInfo |
RepoGroup::$foreignRepos |
Definition at line 14 of file RepoGroup.php.
RepoGroup::$instance [static, protected] |
RepoGroup::$localInfo |
RepoGroup::$localRepo |
Definition at line 14 of file RepoGroup.php.
RepoGroup::$reposInitialised = false |
Definition at line 14 of file RepoGroup.php.
const RepoGroup::MAX_CACHE_SIZE = 1000 |
Definition at line 19 of file RepoGroup.php.