/** * This function set an app as disabled in appconfig. * @param string $app app */ public static function disable($app) { if ($app === 'files') { throw new \Exception("files can't be disabled."); } self::$enabledAppsCache = array(); // flush // check if app is a shipped app or not. if not delete \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app)); // Convert OCS ID to regular application identifier if (self::getInternalAppIdByOcs($app) !== false) { $app = self::getInternalAppIdByOcs($app); } OC_Appconfig::setValue($app, 'enabled', 'no'); }
/** * This function set an app as disabled in appconfig. * * @param string $app app * @throws Exception */ public static function disable($app) { // Convert OCS ID to regular application identifier if (self::getInternalAppIdByOcs($app) !== false) { $app = self::getInternalAppIdByOcs($app); } self::$enabledAppsCache = array(); // flush // check if app is a shipped app or not. if not delete \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app)); $appManager = \OC::$server->getAppManager(); $appManager->disableApp($app); }
/** * This function set an app as disabled in appconfig. * @param string $app app * @throws Exception */ public static function disable($app) { if ($app === 'files') { throw new \Exception("files can't be disabled."); } self::$enabledAppsCache = array(); // flush // check if app is a shipped app or not. if not delete \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app)); OC_Appconfig::setValue($app, 'enabled', 'no'); }
/** * @brief disables an app * @param string $app app * @return bool * * This function set an app as disabled in appconfig. */ public static function disable($app) { self::$enabledAppsCache = array(); // flush // check if app is a shipped app or not. if not delete \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app)); OC_Appconfig::setValue($app, 'enabled', 'no'); // check if app is a shipped app or not. if not delete if (!OC_App::isShipped($app)) { OC_Installer::removeApp($app); } }
/** * This function set an app as disabled in appconfig. * * @param string $app app * @throws Exception */ public static function disable($app) { // Convert OCS ID to regular application identifier if (self::getInternalAppIdByOcs($app) !== false) { $app = self::getInternalAppIdByOcs($app); } // flush self::$enabledAppsCache = array(); // run uninstall steps $appData = OC_App::getAppInfo($app); if (!is_null($appData)) { OC_App::executeRepairSteps($app, $appData['repair-steps']['uninstall']); } // emit disable hook - needed anymore ? \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app)); // finally disable it $appManager = \OC::$server->getAppManager(); $appManager->disableApp($app); }