diff options
Diffstat (limited to 'settings/controller')
-rw-r--r-- | settings/controller/encryptioncontroller.php | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/settings/controller/encryptioncontroller.php b/settings/controller/encryptioncontroller.php index 11640a6283b..7aaf184482f 100644 --- a/settings/controller/encryptioncontroller.php +++ b/settings/controller/encryptioncontroller.php @@ -82,6 +82,20 @@ class EncryptionController extends Controller { } /** + * @param IConfig $config + * @param View $view + * @param Connection $connection + * @param ILogger $logger + * @return Migration + */ + protected function getMigration(IConfig $config, + View $view, + Connection $connection, + ILogger $logger) { + return new Migration($config, $view, $connection, $logger); + } + + /** * start migration * * @return array @@ -92,12 +106,11 @@ class EncryptionController extends Controller { try { - $migration = new Migration($this->config, $this->view, $this->connection, $this->logger); + $migration = $this->getMigration($this->config, $this->view, $this->connection, $this->logger); $migration->reorganizeSystemFolderStructure(); $migration->updateDB(); foreach ($this->userManager->getBackends() as $backend) { - $limit = 500; $offset = 0; do { @@ -112,21 +125,20 @@ class EncryptionController extends Controller { $migration->finalCleanUp(); } catch (\Exception $e) { - return array( - 'data' => array( + return [ + 'data' => [ 'message' => (string)$this->l10n->t('A problem occurred, please check your log files (Error: %s)', [$e->getMessage()]), - ), + ], 'status' => 'error', - ); + ]; } - return array('data' => - array('message' => - (string) $this->l10n->t('Migration Completed') - ), - 'status' => 'success' - ); - + return [ + 'data' => [ + 'message' => (string) $this->l10n->t('Migration Completed'), + ], + 'status' => 'success', + ]; } } |