Merge pull request #4140 from nextcloud/no_encryption_no_wrapper

Don't add the Encryption Storage Wrapper if there are no encryption modules
This commit is contained in:
Björn Schießle 2017-03-31 14:49:38 +02:00 committed by GitHub
commit 85da9378c0
2 changed files with 6 additions and 3 deletions

View File

@ -44,7 +44,7 @@ if [ "$INSTALLED" == "true" ]; then
$OCC app:enable files_external
mkdir -p work/local_storage
OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=./build/integration/work/local_storage`
OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=$PWD/work/local_storage`
ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | tr ' ' '\n' | tail -n1`

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