X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fexternalstore%2FExternalStoreMwstore.php;h=89ac7345173aef973a2ac0d5023867f56a468c07;hb=8c1d27c1d7b4b3bea8fbb5bdd1bc4b7b14e0ac93;hp=17210077f16a63a26e0031a7957d1edc175fade0;hpb=e1ecdea0b1272a2444547128437507673e19525c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/externalstore/ExternalStoreMwstore.php b/includes/externalstore/ExternalStoreMwstore.php index 17210077f1..89ac734517 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; } @@ -66,6 +67,7 @@ class ExternalStoreMwstore extends ExternalStoreMedium { $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; } }