protected function execute(InputInterface $input, OutputInterface $output) {
$appId = $input->getArgument('app-id');
if (\OC_App::isEnabled($appId)) {
- \OC_App::disable($appId);
- $output->writeln($appId . ' disabled');
+ try {
+ \OC_App::disable($appId);
+ $output->writeln($appId . ' disabled');
+ } catch(\Exception $e) {
+ $output->writeln($e->getMessage());
+ }
} else {
$output->writeln('No such app enabled: ' . $appId);
}
* @param string $app app
*/
public static function disable($app) {
+ if($app === 'files') {
+ throw new \Exception("App '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));
* Disable an app for every user
*
* @param string $appId
+ * @throws \Exception if app can't be disabled
*/
public function disableApp($appId) {
+ if($appId === 'files') {
+ throw new \Exception("App 'files' can't be disabled.");
+ }
$this->appConfig->setValue($appId, 'enabled', 'no');
}
}