summaryrefslogtreecommitdiff
path: root/includes/externalstore/ExternalStoreMwstore.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /includes/externalstore/ExternalStoreMwstore.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'includes/externalstore/ExternalStoreMwstore.php')
-rw-r--r--includes/externalstore/ExternalStoreMwstore.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/includes/externalstore/ExternalStoreMwstore.php b/includes/externalstore/ExternalStoreMwstore.php
index aa486796..89ac7345 100644
--- a/includes/externalstore/ExternalStoreMwstore.php
+++ b/includes/externalstore/ExternalStoreMwstore.php
@@ -43,6 +43,7 @@ class ExternalStoreMwstore extends ExternalStoreMedium {
// backends should at least have "read-after-create" consistency.
return $be->getFileContents( array( 'src' => $url ) );
}
+
return false;
}
@@ -63,9 +64,10 @@ class ExternalStoreMwstore extends ExternalStoreMedium {
}
$blobs = array();
foreach ( $pathsByBackend as $backendName => $paths ) {
- $be = FileBackendGroup::get( $backendName );
+ $be = FileBackendGroup::singleton()->get( $backendName );
$blobs = $blobs + $be->getFileContentsMulti( array( 'srcs' => $paths ) );
}
+
return $blobs;
}
@@ -82,14 +84,17 @@ class ExternalStoreMwstore extends ExternalStoreMedium {
// Segregate items by wiki ID for the sake of bookkeeping
$wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : wfWikiID();
- $url = $be->getContainerStoragePath( 'data' ) . '/' .
- rawurlencode( $wiki ) . "/{$rand[0]}/{$rand[1]}/{$rand[2]}/{$id}";
+ $url = $be->getContainerStoragePath( 'data' ) . '/' . rawurlencode( $wiki );
+ $url .= ( $be instanceof FSFileBackend )
+ ? "/{$rand[0]}/{$rand[1]}/{$rand[2]}/{$id}" // keep directories small
+ : "/{$rand[0]}/{$rand[1]}/{$id}"; // container sharding is only 2-levels
$be->prepare( array( 'dir' => dirname( $url ), 'noAccess' => 1, 'noListing' => 1 ) );
if ( $be->create( array( 'dst' => $url, 'content' => $data ) )->isOK() ) {
return $url;
}
}
+
return false;
}
}