diff options
author | Joas Schilling <coding@schilljs.com> | 2023-10-31 12:06:09 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-11-03 15:44:46 +0100 |
commit | 6f39d82031202a2a8d1fb81ea448a2ffdc52cc29 (patch) | |
tree | 26f76451f1462ea5669f1d53e9cd0ebf7d79e7f2 /lib/private/Setup.php | |
parent | 50de7553b582744c7376ca5c7bcff0ba47c1e6b3 (diff) | |
download | nextcloud-server-6f39d82031202a2a8d1fb81ea448a2ffdc52cc29.tar.gz nextcloud-server-6f39d82031202a2a8d1fb81ea448a2ffdc52cc29.zip |
fix(install): Make installing more verbose
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r-- | lib/private/Setup.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php index f167d19adeb..4ef89e14158 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -60,6 +60,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Defaults; use OCP\IGroup; use OCP\IL10N; +use OCP\Migration\IOutput; use OCP\Security\ISecureRandom; use Psr\Log\LoggerInterface; @@ -275,7 +276,7 @@ class Setup { * @param $options * @return array */ - public function install($options) { + public function install($options, ?IOutput $output = null) { $l = $this->l10n; $error = []; @@ -349,6 +350,7 @@ class Setup { $this->config->setValues($newConfigValues); + $this->outputDebug($output, 'Configuring database'); $dbSetup->initialize($options); try { $dbSetup->setupDatabase($username); @@ -367,9 +369,11 @@ class Setup { ]; return $error; } + + $this->outputDebug($output, 'Run server migrations'); try { // apply necessary migrations - $dbSetup->runMigrations(); + $dbSetup->runMigrations($output); } catch (Exception $e) { $error[] = [ 'error' => 'Error while trying to initialise the database: ' . $e->getMessage(), @@ -379,6 +383,7 @@ class Setup { return $error; } + $this->outputDebug($output, 'Create admin user'); //create the user and group $user = null; try { @@ -407,16 +412,19 @@ class Setup { } // Install shipped apps and specified app bundles - Installer::installShippedApps(); + $this->outputDebug($output, 'Install default apps'); + Installer::installShippedApps(false, $output); // create empty file in data dir, so we can later find // out that this is indeed an ownCloud data directory + $this->outputDebug($output, 'Setup data directory'); file_put_contents($config->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', ''); // Update .htaccess files self::updateHtaccess(); self::protectDataDirectory(); + $this->outputDebug($output, 'Install background jobs'); self::installBackgroundJobs(); //and we are done @@ -616,4 +624,10 @@ class Setup { public function canInstallFileExists() { return is_file(\OC::$configDir.'/CAN_INSTALL'); } + + protected function outputDebug(?IOutput $output, string $message): void { + if ($output instanceof IOutput) { + $output->debug($message); + } + } } |