RepoGroup Class Reference
[FileRepo]

Prioritized list of file repositories. More...

List of all members.

Public Member Functions

 __construct ($localInfo, $foreignInfo)
 Construct a group of file repositories.
 findFile ($title, $time=false, $flags=0)
 Search repositories for an image.
 findFiles ($titles)
 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)

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

Protected Member Functions

 newRepo ($info)
 Create a repo class based on an info structure.

Static Protected Attributes

static $instance


Detailed Description

Prioritized list of file repositories.

Definition at line 13 of file RepoGroup.php.


Constructor & Destructor Documentation

RepoGroup::__construct ( localInfo,
foreignInfo 
)

Construct a group of file repositories.

Parameters:
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 54 of file RepoGroup.php.

References $foreignInfo, and $localInfo.


Member Function Documentation

RepoGroup::checkRedirect ( title  ) 

Interface for FileRepo::checkRedirect().

Definition at line 114 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 36 of file RepoGroup.php.

Referenced by ParserTest::teardownGlobals().

RepoGroup::findBySha1 ( hash  ) 

Definition at line 132 of file RepoGroup.php.

References $result, and initialiseRepos().

RepoGroup::findFile ( title,
time = false,
flags = 0 
)

Search repositories for an image.

You can also use wfGetFile() to do this.

Parameters:
mixed $title Title object or string
mixed $time The 14-char timestamp the file should have been uploaded, or false for the current version
mixed $flags FileRepo::FIND_ flags
Returns:
File object or false if it is not found

Definition at line 68 of file RepoGroup.php.

References $flags, $title, and initialiseRepos().

RepoGroup::findFiles ( titles  ) 

Definition at line 85 of file RepoGroup.php.

References $name, $title, initialiseRepos(), and Title::makeTitleSafe().

RepoGroup::forEachForeignRepo ( callback,
params = array() 
)

Call a function for each foreign repo, with the repo object as the first parameter.

Parameters:
$callback callback The function to call
$params array Optional additional parameters to pass to the function

Definition at line 187 of file RepoGroup.php.

References $args.

RepoGroup::getFileProps ( fileName  ) 

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 176 of file RepoGroup.php.

References getRepo().

RepoGroup::getRepo ( index  ) 

Get the repo instance with a given key.

Definition at line 146 of file RepoGroup.php.

References initialiseRepos().

Referenced by getFileProps(), and getLocalRepo().

RepoGroup::getRepoByName ( name  ) 

Get the repo instance by its name.

Definition at line 161 of file RepoGroup.php.

References $key, $name, and initialiseRepos().

RepoGroup::hasForeignRepos (  ) 

Does the installation have any foreign repos set up?

Returns:
bool

Definition at line 201 of file RepoGroup.php.

RepoGroup::initialiseRepos (  ) 

Initialise the $repos array.

Definition at line 208 of file RepoGroup.php.

References $key, and 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 224 of file RepoGroup.php.

Referenced by initialiseRepos().

static RepoGroup::setSingleton ( instance  )  [static]

Set the singleton instance to a given object.

Definition at line 43 of file RepoGroup.php.

References $instance.

static RepoGroup::singleton (  )  [static]

RepoGroup::splitVirtualUrl ( url  ) 

Split a virtual URL into repo, zone and rel parts.

Returns:
an array containing repo, zone and rel

Definition at line 233 of file RepoGroup.php.

References $url.

Referenced by getFileProps().


Member Data Documentation

RepoGroup::$foreignInfo

Definition at line 15 of file RepoGroup.php.

Referenced by __construct().

RepoGroup::$foreignRepos

Definition at line 14 of file RepoGroup.php.

RepoGroup::$instance [static, protected]

Definition at line 17 of file RepoGroup.php.

Referenced by setSingleton().

RepoGroup::$localInfo

Definition at line 15 of file RepoGroup.php.

Referenced by __construct().

RepoGroup::$localRepo

Definition at line 14 of file RepoGroup.php.

RepoGroup::$reposInitialised = false

Definition at line 14 of file RepoGroup.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:45 2009 for MediaWiki by  doxygen 1.5.9