Remove OC_App::removeApp
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
a68895e334
commit
efbdad2d0c
3 changed files with 7 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -419,19 +419,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.
|
||||
*
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue