File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 3939use OCP \IGroupManager ;
4040use OCP \IUser ;
4141use OCP \IUserSession ;
42+ use OCP \App ;
4243use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
4344
4445class AppManager implements IAppManager {
@@ -280,6 +281,16 @@ public function disableApp($appId) {
280281 }
281282 unset($ this ->installedAppsCache [$ appId ]);
282283 $ this ->appConfig ->setValue ($ appId , 'enabled ' , 'no ' );
284+
285+ // run uninstall steps
286+ $ appData = App::getAppInfo ($ appId );
287+ if (!is_null ($ appData )) {
288+ \OC_App::executeRepairSteps ($ appId , $ appData ['repair-steps ' ]['uninstall ' ]);
289+ }
290+
291+ // emit disable hook - needed anymore ?
292+ \OC_Hook::emit ('OC_App ' , 'pre_disable ' , array ('app ' => $ appId ));
293+
283294 $ this ->dispatcher ->dispatch (ManagerEvent::EVENT_APP_DISABLE , new ManagerEvent (
284295 ManagerEvent::EVENT_APP_DISABLE , $ appId
285296 ));
Original file line number Diff line number Diff line change @@ -420,16 +420,6 @@ public static function disable($app) {
420420 // flush
421421 self ::$ enabledAppsCache = array ();
422422
423- // run uninstall steps
424- $ appData = OC_App::getAppInfo ($ app );
425- if (!is_null ($ appData )) {
426- OC_App::executeRepairSteps ($ app , $ appData ['repair-steps ' ]['uninstall ' ]);
427- }
428-
429- // emit disable hook - needed anymore ?
430- \OC_Hook::emit ('OC_App ' , 'pre_disable ' , array ('app ' => $ app ));
431-
432- // finally disable it
433423 $ appManager = \OC ::$ server ->getAppManager ();
434424 $ appManager ->disableApp ($ app );
435425 }
Original file line number Diff line number Diff line change 3939$ appIds = (array )$ _POST ['appid ' ];
4040foreach ($ appIds as $ appId ) {
4141 $ appId = OC_App::cleanAppId ($ appId );
42- OC_App:: disable ($ appId );
42+ \ OC :: $ server -> getAppManager ()-> disableApp ($ appId );
4343}
4444OC_JSON ::success ();
You can’t perform that action at this time.
0 commit comments