[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/filerepo/ -> RepoGroup.php (summary)

Prioritized list of file repositories. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 465 lines (12 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

RepoGroup:: (20 methods):
  singleton()
  destroySingleton()
  setSingleton()
  __construct()
  findFile()
  findFiles()
  checkRedirect()
  findFileFromKey()
  findBySha1()
  findBySha1s()
  getRepo()
  getRepoByName()
  getLocalRepo()
  forEachForeignRepo()
  hasForeignRepos()
  initialiseRepos()
  newRepo()
  splitVirtualUrl()
  getFileProps()
  clearCache()


Class: RepoGroup  - X-Ref

Prioritized list of file repositories

singleton()   X-Ref
Get a RepoGroup instance. At present only one instance of RepoGroup is
needed in a MediaWiki invocation, this may change in the future.

return: RepoGroup

destroySingleton()   X-Ref
Destroy the singleton instance, so that a new one will be created next
time singleton() is called.


setSingleton( $instance )   X-Ref
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()

param: RepoGroup $instance

__construct( $localInfo, $foreignInfo )   X-Ref
Construct a group of file repositories.

param: array $localInfo Associative array for local repo's info
param: array $foreignInfo Array of repository info arrays.

findFile( $title, $options = array()   X-Ref
Search repositories for an image.
You can also use wfFindFile() to do this.

param: Title|string $title Title object or string
param: array $options Associative array of options:
return: File|bool False if title is not found

findFiles( array $inputItems, $flags = 0 )   X-Ref
Search repositories for many files at once.

param: array $inputItems An array of titles, or an array of findFile() options with
param: int $flags Supports:
return: array Map of (file name => File objects) for matches

checkRedirect( Title $title )   X-Ref
Interface for FileRepo::checkRedirect()

param: Title $title
return: bool|Title

findFileFromKey( $hash, $options = array()   X-Ref
Find an instance of the file with this key, created at the specified time
Returns false if the file does not exist.

param: string $hash Base 36 SHA-1 hash
param: array $options Option array, same as findFile()
return: File|bool File object or false if it is not found

findBySha1( $hash )   X-Ref
Find all instances of files with this key

param: string $hash Base 36 SHA-1 hash
return: File[]

findBySha1s( array $hashes )   X-Ref
Find all instances of files with this keys

param: array $hashes Base 36 SHA-1 hashes
return: array Array of array of File objects

getRepo( $index )   X-Ref
Get the repo instance with a given key.

param: string|int $index
return: bool|LocalRepo

getRepoByName( $name )   X-Ref
Get the repo instance by its name

param: string $name
return: bool

getLocalRepo()   X-Ref
Get the local repository, i.e. the one corresponding to the local image
table. Files are typically uploaded to the local repository.

return: LocalRepo

forEachForeignRepo( $callback, $params = array()   X-Ref
Call a function for each foreign repo, with the repo object as the
first parameter.

param: callable $callback The function to call
param: array $params Optional additional parameters to pass to the function
return: bool

hasForeignRepos()   X-Ref
Does the installation have any foreign repos set up?

return: bool

initialiseRepos()   X-Ref
Initialise the $repos array


newRepo( $info )   X-Ref
Create a repo class based on an info structure

param: array $info
return: FileRepo

splitVirtualUrl( $url )   X-Ref
Split a virtual URL into repo, zone and rel parts

param: string $url
return: array Containing repo, zone and rel

getFileProps( $fileName )   X-Ref

param: string $fileName
return: array

clearCache( Title $title = null )   X-Ref
Clear RepoGroup process cache used for finding a file

param: Title|null $title Title of the file or null to clear all files



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1