MediaWiki  REL1_19
ExternalStore Class Reference

Constructor class for data kept in external repositories. More...

List of all members.

Public Member Functions

 __construct ($params=array())

Static Public Member Functions

static fetchFromURL ($url, $params=array())
 Fetch data from given URL.
static getStoreObject ($proto, $params=array())
 Get an external store object of the given type, with the given parameters.
static insert ($url, $data, $params=array())
 Store a data item to an external store, identified by a partial URL The protocol part is used to identify the class, the rest is passed to the class itself as a parameter.
static insertToDefault ($data, $storageParams=array())
 Like insert() above, but does more of the work for us.
static insertToForeignDefault ($data, $wiki)

Public Attributes

 $mParams

Detailed Description

Constructor class for data kept in external repositories.

External repositories might be populated by maintenance/async scripts, thus partial moving of data may be possible, as well as possibility to have any storage format (i.e. for archives)

Definition at line 15 of file ExternalStore.php.


Constructor & Destructor Documentation

ExternalStore::__construct ( params = array())

Definition at line 18 of file ExternalStore.php.


Member Function Documentation

static ExternalStore::fetchFromURL ( url,
params = array() 
) [static]

Fetch data from given URL.

Parameters:
$urlString: The URL of the text to get
$paramsArray: associative array of parameters for the ExternalStore object.
Returns:
The text stored or false on error

Definition at line 29 of file ExternalStore.php.

References $path, $url, $wgExternalStores, and getStoreObject().

Referenced by DumpRev\execute(), FixBug20757\execute(), Revision\getRevisionText(), and ExternalStoreTest\testExternalStoreDoesNotFetchIncorrectURL().

Here is the call graph for this function:

Here is the caller graph for this function:

static ExternalStore::getStoreObject ( proto,
params = array() 
) [static]

Get an external store object of the given type, with the given parameters.

Parameters:
$protoString: type of external storage, should be a value in $wgExternalStores
$paramsArray: associative array of parameters for the ExternalStore object.
Returns:
ExternalStore subclass or false on error

Definition at line 60 of file ExternalStore.php.

References $wgExternalStores, and MWInit\classExists().

Referenced by DumpRev\execute(), fetchFromURL(), insert(), and insertToDefault().

Here is the call graph for this function:

Here is the caller graph for this function:

static ExternalStore::insert ( url,
data,
params = array() 
) [static]

Store a data item to an external store, identified by a partial URL The protocol part is used to identify the class, the rest is passed to the class itself as a parameter.

Parameters:
$url
$data
$paramsarray
Returns:
string|false The URL of the stored data item, or false on error

Definition at line 86 of file ExternalStore.php.

References $url, and getStoreObject().

Here is the call graph for this function:

static ExternalStore::insertToDefault ( data,
storageParams = array() 
) [static]

Like insert() above, but does more of the work for us.

This function does not need a url param, it builds it by itself. It also fails-over to the next possible clusters.

Parameters:
$dataString
$storageParamsArray: associative array of parameters for the ExternalStore object.
Returns:
string The URL of the stored data item, or false on error

Definition at line 105 of file ExternalStore.php.

References $url, $wgDefaultExternalStore, getStoreObject(), wfDebug(), and wfDebugLog().

Referenced by Revision\insertOn(), and insertToForeignDefault().

Here is the call graph for this function:

Here is the caller graph for this function:

static ExternalStore::insertToForeignDefault ( data,
wiki 
) [static]
Parameters:
$data
$wiki
Returns:
string

Definition at line 148 of file ExternalStore.php.

References insertToDefault().

Here is the call graph for this function:


Member Data Documentation

ExternalStore::$mParams

Definition at line 16 of file ExternalStore.php.


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