예제 #1
0
 /**
  * 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);
 }