diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-03-29 12:23:46 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-03-29 18:57:56 +0200 |
commit | 111c9f7563f1ac43d8e615a2aa8dc89375a1ffb6 (patch) | |
tree | d2c908d6b62374ac88770232b329fdf2df0710a5 /lib/private/Encryption | |
parent | c1030a34a589a27e448a5f97d5e40e0459692a89 (diff) | |
download | nextcloud-server-111c9f7563f1ac43d8e615a2aa8dc89375a1ffb6.tar.gz nextcloud-server-111c9f7563f1ac43d8e615a2aa8dc89375a1ffb6.zip |
Don't add the Encryption Storage Wrapper if there are no encryption modules
fixes #4125
If there is no encryption module enabled it makes no sense to setup the
encryption wrapper (because we can't do anything anyway).
This saves reading the header of files.
Especialy on external storage/objectstore this should improve
performance
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Encryption')
-rw-r--r-- | lib/private/Encryption/Manager.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Encryption/Manager.php b/lib/private/Encryption/Manager.php index 4d40675801e..9053e371b65 100644 --- a/lib/private/Encryption/Manager.php +++ b/lib/private/Encryption/Manager.php @@ -254,8 +254,11 @@ class Manager implements IManager { * Add storage wrapper */ public function setupStorage() { - $encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger); - Filesystem::addStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'), 2); + // If encryption is disabled and there are no loaded modules it makes no sense to load the wrapper + if (!empty($this->encryptionModules) || $this->isEnabled()) { + $encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger); + Filesystem::addStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'), 2); + } } |