MediaWiki  1.27.2
FileBackendGroup Class Reference

Class to handle file backend registration. More...

Collaboration diagram for FileBackendGroup:

Public Member Functions

 backendFromPath ($storagePath)
 Get an appropriate backend object from a storage path. More...
 
 config ($name)
 Get the config array for a backend object with a given name. More...
 
 get ($name)
 Get the backend object with a given name. More...
 
 guessMimeInternal ($storagePath, $content, $fsPath)
 

Static Public Member Functions

static destroySingleton ()
 Destroy the singleton instance. More...
 
static singleton ()
 

Protected Member Functions

 __construct ()
 
 initFromGlobals ()
 Register file backends from the global variables. More...
 
 register (array $configs, $readOnlyReason=null)
 Register an array of file backend configurations. More...
 

Protected Attributes

array $backends = []
 (name => ('class' => string, 'config' => array, 'instance' => object)) More...
 

Static Protected Attributes

static FileBackendGroup $instance = null
 

Detailed Description

Class to handle file backend registration.

Since
1.19

Definition at line 31 of file FileBackendGroup.php.

Constructor & Destructor Documentation

FileBackendGroup::__construct ( )
protected

Definition at line 38 of file FileBackendGroup.php.

Member Function Documentation

FileBackendGroup::backendFromPath (   $storagePath)

Get an appropriate backend object from a storage path.

Parameters
string$storagePath
Returns
FileBackend|null Backend or null on failure

Definition at line 199 of file FileBackendGroup.php.

References list, and FileBackend\splitStoragePath().

FileBackendGroup::config (   $name)

Get the config array for a backend object with a given name.

Parameters
string$name
Returns
array
Exceptions
FileBackendException

Definition at line 184 of file FileBackendGroup.php.

References $name.

FileBackendGroup::get (   $name)

Get the backend object with a given name.

Parameters
string$name
Returns
FileBackend
Exceptions
FileBackendException

Definition at line 152 of file FileBackendGroup.php.

References $name, FileJournal\factory(), ObjectCache\getMainWANInstance(), LockManagerGroup\singleton(), and wfWikiID().

FileBackendGroup::guessMimeInternal (   $storagePath,
  $content,
  $fsPath 
)
Parameters
string$storagePath
string | null$content
string | null$fsPath
Returns
string
Since
1.27

Definition at line 215 of file FileBackendGroup.php.

References $content, $ext, $type, FileBackend\extensionFromPath(), TempFSFile\factory(), false, and MimeMagic\singleton().

FileBackendGroup::initFromGlobals ( )
protected

Register file backends from the global variables.

Definition at line 63 of file FileBackendGroup.php.

References $wgFileBackends, $wgForeignFileRepos, $wgLocalFileRepo, as, global, and wfConfiguredReadOnlyReason().

FileBackendGroup::register ( array  $configs,
  $readOnlyReason = null 
)
protected

Register an array of file backend configurations.

Parameters
array$configs
string | null$readOnlyReason
Exceptions
FileBackendException

Definition at line 119 of file FileBackendGroup.php.

References $name, and as.

Member Data Documentation

array FileBackendGroup::$backends = []
protected

(name => ('class' => string, 'config' => array, 'instance' => object))

Definition at line 36 of file FileBackendGroup.php.

FileBackendGroup FileBackendGroup::$instance = null
staticprotected

Definition at line 33 of file FileBackendGroup.php.


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