[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/externalstore/ -> ExternalStore.php (summary)

(no description)

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

Defines 1 class

ExternalStore:: (7 methods):
  getStoreObject()
  fetchFromURL()
  batchFetchFromURLs()
  insert()
  insertToDefault()
  insertWithFallback()
  insertToForeignDefault()


Class: ExternalStore  - X-Ref

Constructor class for key/value blob data kept in external repositories.

Objects in external stores are defined by a special URL. The URL is of
the form "<store protocol>://<location>/<object name>". The protocol is used
to determine what ExternalStoreMedium class is used. The location identifies
particular storage instances or database clusters for store class to use.

When an object is inserted into a store, the calling code uses a partial URL of
the form "<store protocol>://<location>" and receives the full object URL on success.
This is useful since object names can be sequential IDs, UUIDs, or hashes.
Callers are not responsible for unique name generation.

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

getStoreObject( $proto, array $params = array()   X-Ref
Get an external store object of the given type, with the given parameters

param: string $proto Type of external storage, should be a value in $wgExternalStores
param: array $params Associative array of ExternalStoreMedium parameters
return: ExternalStoreMedium|bool The store class or false on error

fetchFromURL( $url, array $params = array()   X-Ref
Fetch data from given URL

param: string $url The URL of the text to get
param: array $params Associative array of ExternalStoreMedium parameters
return: string|bool The text stored or false on error

batchFetchFromURLs( array $urls )   X-Ref
Fetch data from multiple URLs with a minimum of round trips

param: array $urls The URLs of the text to get
return: array Map from url to its data.  Data is either string when found

insert( $url, $data, array $params = array()   X-Ref
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.

param: string $url A partial external store URL ("<store type>://<location>")
param: string $data
param: array $params Associative array of ExternalStoreMedium parameters
return: string|bool The URL of the stored data item, or false on error

insertToDefault( $data, array $params = array()   X-Ref
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
provided by $wgDefaultExternalStore.

param: string $data
param: array $params Associative array of ExternalStoreMedium parameters
return: string|bool The URL of the stored data item, or false on error

insertWithFallback( array $tryStores, $data, array $params = array()   X-Ref
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
as provided in the first parameter.

param: array $tryStores Refer to $wgDefaultExternalStore
param: string $data
param: array $params Associative array of ExternalStoreMedium parameters
return: string|bool The URL of the stored data item, or false on error

insertToForeignDefault( $data, $wiki )   X-Ref

param: string $data
param: string $wiki
return: string|bool The URL of the stored data item, or false on error



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