[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

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

External storage in SQL database. 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: 301 lines (9 kb)
Included or required: 1 time
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

ExternalStoreDB:: (11 methods):
  fetchFromURL()
  batchFetchFromURLs()
  store()
  getLoadBalancer()
  getSlave()
  getMaster()
  getTable()
  fetchBlob()
  batchFetchBlobs()
  mergeBatchResult()
  parseURL()


Class: ExternalStoreDB  - X-Ref

DB accessable external objects.

In this system, each store "location" maps to a database "cluster".
The clusters must be defined in the normal LBFactory configuration.

fetchFromURL( $url )   X-Ref
The provided URL is in the form of DB://cluster/id
or DB://cluster/id/itemid for concatened storage.


batchFetchFromURLs( array $urls )   X-Ref
Fetch data from given external store URLs.
The provided URLs are in the form of DB://cluster/id
or DB://cluster/id/itemid for concatened storage.

param: array $urls An array of external store URLs
return: array A map from url to stored content. Failed results

store( $cluster, $data )   X-Ref


getLoadBalancer( $cluster )   X-Ref
Get a LoadBalancer for the specified cluster

param: string $cluster Cluster name
return: LoadBalancer

getSlave( $cluster )   X-Ref
Get a slave database connection for the specified cluster

param: string $cluster Cluster name
return: DatabaseBase

getMaster( $cluster )   X-Ref
Get a master database connection for the specified cluster

param: string $cluster Cluster name
return: DatabaseBase

getTable( $db )   X-Ref
Get the 'blobs' table name for this database

param: DatabaseBase $db
return: string Table name ('blobs' by default)

fetchBlob( $cluster, $id, $itemID )   X-Ref
Fetch a blob item out of the database; a cache of the last-loaded
blob will be kept so that multiple loads out of a multi-item blob
can avoid redundant database access and decompression.

param: string $cluster
param: string $id
param: string $itemID
return: mixed

batchFetchBlobs( $cluster, array $ids )   X-Ref
Fetch multiple blob items out of the database

param: string $cluster A cluster name valid for use with LBFactory
param: array $ids A map from the blob_id's to look for to the requested itemIDs in the blobs
return: array A map from the blob_id's requested to their content.

mergeBatchResult( array &$ret, array &$ids, $res )   X-Ref
Helper function for self::batchFetchBlobs for merging master/slave results

param: array &$ret Current self::batchFetchBlobs return value
param: array &$ids Map from blob_id to requested itemIDs
param: mixed $res DB result from DatabaseBase::select

parseURL( $url )   X-Ref

param: string $url
return: array



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