diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/externalstore/ExternalStoreMwstore.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/externalstore/ExternalStoreMwstore.php')
-rw-r--r-- | includes/externalstore/ExternalStoreMwstore.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/includes/externalstore/ExternalStoreMwstore.php b/includes/externalstore/ExternalStoreMwstore.php index 0911cca1..aa486796 100644 --- a/includes/externalstore/ExternalStoreMwstore.php +++ b/includes/externalstore/ExternalStoreMwstore.php @@ -47,6 +47,29 @@ class ExternalStoreMwstore extends ExternalStoreMedium { } /** + * Fetch data from given external store URLs. + * The URL returned is of the form of the form mwstore://backend/container/wiki/id + * + * @param array $urls An array of external store URLs + * @return array A map from url to stored content. Failed results are not represented. + */ + public function batchFetchFromURLs( array $urls ) { + $pathsByBackend = array(); + foreach ( $urls as $url ) { + $be = FileBackendGroup::singleton()->backendFromPath( $url ); + if ( $be instanceof FileBackend ) { + $pathsByBackend[$be->getName()][] = $url; + } + } + $blobs = array(); + foreach ( $pathsByBackend as $backendName => $paths ) { + $be = FileBackendGroup::get( $backendName ); + $blobs = $blobs + $be->getFileContentsMulti( array( 'srcs' => $paths ) ); + } + return $blobs; + } + + /** * @see ExternalStoreMedium::store() */ public function store( $backend, $data ) { |