summaryrefslogtreecommitdiffstats
path: root/lib/private/Updater.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-10-31 11:07:54 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-10-31 17:17:47 +0100
commit8acb54aa0b32a8b750f8ab3aba9f63aa931be7d1 (patch)
treeaf744fe68adce931a8bb1b5918c93210b828124e /lib/private/Updater.php
parentdf7fd2b57cb211b3a6a9febdca4ab0a21baed19d (diff)
downloadnextcloud-server-8acb54aa0b32a8b750f8ab3aba9f63aa931be7d1.tar.gz
nextcloud-server-8acb54aa0b32a8b750f8ab3aba9f63aa931be7d1.zip
Add update support
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/Updater.php')
-rw-r--r--lib/private/Updater.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/Updater.php b/lib/private/Updater.php
index 646fc031a83..cd2934f7196 100644
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -1,6 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @copyright Copyright (c) 2016, Lukas Reschke <lukas@statuscode.ch>
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Frank Karlitschek <frank@karlitschek.de>
@@ -426,11 +427,15 @@ class Updater extends BasicEmitter {
private function upgradeAppStoreApps(array $disabledApps) {
foreach($disabledApps as $app) {
try {
- if (Installer::isUpdateAvailable($app)) {
- $ocsId = \OC::$server->getConfig()->getAppValue($app, 'ocsid', '');
-
- $this->emit('\OC\Updater', 'upgradeAppStoreApp', array($app));
- Installer::updateAppByOCSId($ocsId);
+ $installer = new Installer(
+ \OC::$server->getAppFetcher(),
+ \OC::$server->getHTTPClientService(),
+ \OC::$server->getTempManager(),
+ $this->log
+ );
+ if (Installer::isUpdateAvailable($app, \OC::$server->getAppFetcher())) {
+ $this->emit('\OC\Updater', 'upgradeAppStoreApp', [$app]);
+ $installer->updateAppstoreApp($app);
}
} catch (\Exception $ex) {
$this->log->logException($ex, ['app' => 'core']);