Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch upgradeAppStoreApps event #27648

Merged
merged 2 commits into from
Apr 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep old events for backward compatibility ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PVince81 it was not me, who commented that out. IIRC it was commented when app management part was stripped from core

// 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