Skip to content

Commit 2edba71

Browse files
committed
split up storage path into fragments to prevent having directories with a million pods
1 parent ff1d004 commit 2edba71

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/StorageServer.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,16 @@ public static function getFileSystem() {
8484
if (!self::storageIdExists($storageId)) {
8585
throw new \Exception("Storage does not exist");
8686
}
87+
if (is_dir(STORAGEBASE . "$storageId/")) { // backwards compatiblity check
88+
$storagePath = $storageId;
89+
} else {
90+
$storagePath = implode("/", str_split($storageId, 4));
91+
}
92+
8793
// The internal adapter
8894
$adapter = new \League\Flysystem\Adapter\Local(
8995
// Determine root directory
90-
STORAGEBASE . "$storageId/"
96+
STORAGEBASE . "$storagePath/"
9197
);
9298

9399
$graph = new \EasyRdf\Graph();

0 commit comments

Comments
 (0)