aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Installer.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-10-31 12:06:09 +0100
committerJoas Schilling <coding@schilljs.com>2023-11-03 15:44:46 +0100
commit6f39d82031202a2a8d1fb81ea448a2ffdc52cc29 (patch)
tree26f76451f1462ea5669f1d53e9cd0ebf7d79e7f2 /lib/private/Installer.php
parent50de7553b582744c7376ca5c7bcff0ba47c1e6b3 (diff)
downloadnextcloud-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/Installer.php')
-rw-r--r--lib/private/Installer.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index dc81135b644..dd4f1f790e3 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -53,6 +53,7 @@ use OCP\HintException;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\ITempManager;
+use OCP\Migration\IOutput;
use phpseclib\File\X509;
use Psr\Log\LoggerInterface;
@@ -536,7 +537,10 @@ class Installer {
* working ownCloud at the end instead of an aborted update.
* @return array Array of error messages (appid => Exception)
*/
- public static function installShippedApps($softErrors = false) {
+ public static function installShippedApps($softErrors = false, ?IOutput $output = null) {
+ if ($output instanceof IOutput) {
+ $output->debug('Installing shipped apps');
+ }
$appManager = \OC::$server->getAppManager();
$config = \OC::$server->getConfig();
$errors = [];
@@ -551,7 +555,7 @@ class Installer {
&& $config->getAppValue($filename, 'enabled') !== 'no') {
if ($softErrors) {
try {
- Installer::installShippedApp($filename);
+ Installer::installShippedApp($filename, $output);
} catch (HintException $e) {
if ($e->getPrevious() instanceof TableExistsException) {
$errors[$filename] = $e;
@@ -560,7 +564,7 @@ class Installer {
throw $e;
}
} else {
- Installer::installShippedApp($filename);
+ Installer::installShippedApp($filename, $output);
}
$config->setAppValue($filename, 'enabled', 'yes');
}
@@ -578,9 +582,12 @@ class Installer {
/**
* install an app already placed in the app folder
* @param string $app id of the app to install
- * @return integer
+ * @return string
*/
- public static function installShippedApp($app) {
+ public static function installShippedApp($app, ?IOutput $output = null) {
+ if ($output instanceof IOutput) {
+ $output->debug('Installing ' . $app);
+ }
//install the database
$appPath = OC_App::getAppPath($app);
\OC_App::registerAutoloading($app, $appPath);
@@ -588,6 +595,9 @@ class Installer {
$config = \OC::$server->getConfig();
$ms = new MigrationService($app, \OC::$server->get(Connection::class));
+ if ($output instanceof IOutput) {
+ $ms->setOutput($output);
+ }
$previousVersion = $config->getAppValue($app, 'installed_version', false);
$ms->migrate('latest', !$previousVersion);
@@ -598,6 +608,9 @@ class Installer {
if (is_null($info)) {
return false;
}
+ if ($output instanceof IOutput) {
+ $output->debug('Registering tasks of ' . $app);
+ }
\OC_App::setupBackgroundJobs($info['background-jobs']);
OC_App::executeRepairSteps($app, $info['repair-steps']['install']);