From 4a9361905d9013c7132d3226c921ce6d995b36e4 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Thu, 27 Oct 2016 14:15:59 +0200 Subject: make object prefix configurable --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/private/Files/ObjectStore') diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 0f0229c9ca5..2dcf830cc1e 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -48,6 +48,8 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { */ protected $user; + private $objectPrefix = 'urn:oid:'; + public function __construct($params) { if (isset($params['objectstore']) && $params['objectstore'] instanceof IObjectStore) { $this->objectStore = $params['objectstore']; @@ -59,6 +61,9 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { } else { $this->id = 'object::store:' . $this->objectStore->getStorageId(); } + if (isset($params['objectPrefix'])) { + $this->objectPrefix = $params['objectPrefix']; + } //initialize cache with root directory in cache if (!$this->is_dir('/')) { $this->mkdir('/'); @@ -216,7 +221,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { */ protected function getURN($fileId) { if (is_numeric($fileId)) { - return 'urn:oid:' . $fileId; + return $this->objectPrefix . $fileId; } return null; } -- cgit v1.2.3