diff options
Diffstat (limited to 'lib/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index 8aa8b0703d7..70d68863788 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -32,7 +32,6 @@ namespace OC; -use OC\Core\Command\Log\Manage; use OC\Hooks\BasicEmitter; use OC_App; use OC_Installer; @@ -199,15 +198,13 @@ class Updater extends BasicEmitter { $installedVersion = $this->config->getSystemValue('version', '0.0.0'); $currentVersion = implode('.', \OC_Util::getVersion()); - if ($this->log) { - $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); - } + $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); $success = true; try { $this->doUpgrade($currentVersion, $installedVersion); } catch (\Exception $exception) { - \OCP\Util::logException('update', $exception); + $this->log->logException($exception, ['app' => 'core']); $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage())); $success = false; } @@ -235,6 +232,7 @@ class Updater extends BasicEmitter { private function getAllowedPreviousVersion() { // this should really be a JSON file require \OC::$SERVERROOT . '/version.php'; + /** @var array $OC_VersionCanBeUpgradedFrom */ return implode('.', $OC_VersionCanBeUpgradedFrom); } @@ -497,11 +495,15 @@ class Updater extends BasicEmitter { */ private function upgradeAppStoreApps(array $disabledApps) { foreach($disabledApps as $app) { - if (OC_Installer::isUpdateAvailable($app)) { - $ocsId = \OC::$server->getConfig()->getAppValue($app, 'ocsid', ''); + try { + if (OC_Installer::isUpdateAvailable($app)) { + $ocsId = \OC::$server->getConfig()->getAppValue($app, 'ocsid', ''); - $this->emit('\OC\Updater', 'upgradeAppStoreApp', array($app)); - OC_Installer::updateAppByOCSId($ocsId); + $this->emit('\OC\Updater', 'upgradeAppStoreApp', array($app)); + OC_Installer::updateAppByOCSId($ocsId); + } + } catch (\Exception $ex) { + $this->log->logException($ex, ['app' => 'core']); } } } |