Browse Source

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>
tags/v12.0.0beta1
Roeland Jago Douma 7 years ago
parent
commit
111c9f7563
No account linked to committer's email address
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      lib/private/Encryption/Manager.php

+ 5
- 2
lib/private/Encryption/Manager.php View File

@@ -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);
}
}



Loading…
Cancel
Save