Exemple #1
0
 /**
  * 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');
 }
Exemple #2
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);
     }
     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);
 }
Exemple #3
0
 /**
  * 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');
 }
Exemple #4
0
 /**
  * @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);
     }
 }
Exemple #5
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);
 }