diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-01-29 13:41:00 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-31 14:15:12 +0100 |
commit | efbdad2d0c5ee26fafe48cafb4bf4703b23ea1fd (patch) | |
tree | 97bcb0465886f975f356dfc8623deb79d77f9549 | |
parent | a68895e33427483f149e55ae3d6ec30315d8ac96 (diff) | |
download | nextcloud-server-efbdad2d0c5ee26fafe48cafb4bf4703b23ea1fd.tar.gz nextcloud-server-efbdad2d0c5ee26fafe48cafb4bf4703b23ea1fd.zip |
Remove OC_App::removeApp
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | lib/private/Installer.php | 3 | ||||
-rw-r--r-- | lib/private/legacy/app.php | 13 | ||||
-rw-r--r-- | settings/ajax/uninstallapp.php | 5 |
3 files changed, 7 insertions, 14 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 6a78ea329cc..ad2dcb60f20 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -471,6 +471,9 @@ class Installer { */ public function removeApp($appId) { if($this->isDownloaded( $appId )) { + if (\OC::$server->getAppManager()->isShipped($appId)) { + return false; + } $appDir = OC_App::getInstallPath() . '/' . $appId; OC_Helper::rmdirr($appDir); return true; diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index e3da5f350a5..b19d63f560e 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -420,19 +420,6 @@ class OC_App { } /** - * @param string $app - * @return bool - */ - public static function removeApp($app) { - if (\OC::$server->getAppManager()->isShipped($app)) { - return false; - } - - $installer = \OC::$server->query(Installer::class); - return $installer->removeApp($app); - } - - /** * This function set an app as disabled in appconfig. * * @param string $app app diff --git a/settings/ajax/uninstallapp.php b/settings/ajax/uninstallapp.php index a932e2d79e9..63107905b02 100644 --- a/settings/ajax/uninstallapp.php +++ b/settings/ajax/uninstallapp.php @@ -40,7 +40,10 @@ if (!array_key_exists('appid', $_POST)) { $appId = (string)$_POST['appid']; $appId = OC_App::cleanAppId($appId); -$result = OC_App::removeApp($appId); +// FIXME: move to controller +/** @var \OC\Installer $installer */ +$installer = \OC::$server->query(\OC\Installer::class); +$result = $installer->removeApp($app); if($result !== false) { // FIXME: Clear the cache - move that into some sane helper method \OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-0'); |