Skip to content

Commit

Permalink
Merge pull request #27648 from owncloud/update-from-market
Browse files Browse the repository at this point in the history
Dispatch upgradeAppStoreApps event
  • Loading branch information
Vincent Petry authored Apr 18, 2017
2 parents 3e670cd + e9734b0 commit 39c01cc
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions lib/private/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ private function checkAppsRequirements() {
$info = OC_App::getAppInfo($app);
if(!OC_App::isAppCompatible($version, $info)) {
OC_App::disable($app);
$disabledApps[]= $app;
$this->emit('\OC\Updater', 'incompatibleAppDisabled', [$app]);
continue;
}
// no need to disable any app in case this is a non-core upgrade
if (!$isCoreUpgrade) {
Expand Down Expand Up @@ -386,23 +388,18 @@ private function isCodeUpgrade() {
* @throws \Exception
*/
private function upgradeAppStoreApps(array $disabledApps) {

//
// TODO: integrate market app in here
//

// foreach($disabledApps as $app) {
// try {
// if (Installer::isUpdateAvailable($app)) {
// $ocsId = \OC::$server->getConfig()->getAppValue($app, 'ocsid', '');
//
// $this->emit('\OC\Updater', 'upgradeAppStoreApp', [$app]);
// Installer::updateAppByOCSId($ocsId);
// }
// } catch (\Exception $ex) {
// $this->log->logException($ex, ['app' => 'core']);
// }
// }
$dispatcher = \OC::$server->getEventDispatcher();
foreach($disabledApps as $app) {
try {
$this->emit('\OC\Updater', 'upgradeAppStoreApp', [$app]);
$dispatcher->dispatch(
self::class . '::upgradeAppStoreApps',
new GenericEvent($app)
);
} catch (\Exception $ex) {
$this->log->logException($ex, ['app' => 'core']);
}
}
}

/**
Expand Down

0 comments on commit 39c01cc

Please sign in to comment.