Remove OC_App::removeApp
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
a68895e334
commit
efbdad2d0c
|
@ -471,6 +471,9 @@ class Installer {
|
||||||
*/
|
*/
|
||||||
public function removeApp($appId) {
|
public function removeApp($appId) {
|
||||||
if($this->isDownloaded( $appId )) {
|
if($this->isDownloaded( $appId )) {
|
||||||
|
if (\OC::$server->getAppManager()->isShipped($appId)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$appDir = OC_App::getInstallPath() . '/' . $appId;
|
$appDir = OC_App::getInstallPath() . '/' . $appId;
|
||||||
OC_Helper::rmdirr($appDir);
|
OC_Helper::rmdirr($appDir);
|
||||||
return true;
|
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.
|
* This function set an app as disabled in appconfig.
|
||||||
*
|
*
|
||||||
|
|
|
@ -40,7 +40,10 @@ if (!array_key_exists('appid', $_POST)) {
|
||||||
$appId = (string)$_POST['appid'];
|
$appId = (string)$_POST['appid'];
|
||||||
$appId = OC_App::cleanAppId($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) {
|
if($result !== false) {
|
||||||
// FIXME: Clear the cache - move that into some sane helper method
|
// FIXME: Clear the cache - move that into some sane helper method
|
||||||
\OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-0');
|
\OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-0');
|
||||||
|
|
Loading…
Reference in New Issue