diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppManager.php | 9 | ||||
-rw-r--r-- | lib/public/App/IAppManager.php | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 6c1f5ba6940..42777266249 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -32,7 +32,6 @@ namespace OC\App; use OCP\App\AppPathNotFoundException; -use OC_App; use OCP\App\IAppManager; use OCP\App\ManagerEvent; use OCP\IAppConfig; @@ -211,12 +210,12 @@ class AppManager implements IAppManager { * Enable an app for every user * * @param string $appId - * @throws \Exception + * @throws AppPathNotFoundException */ public function enableApp($appId) { - if(OC_App::getAppPath($appId) === false) { - throw new \Exception("$appId can't be enabled since it is not installed."); - } + // Check if app exists + $this->getAppPath($appId); + $this->installedAppsCache[$appId] = 'yes'; $this->appConfig->setValue($appId, 'enabled', 'yes'); $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent( diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 72c99777124..107297bc890 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -57,6 +57,7 @@ interface IAppManager { * Enable an app for every user * * @param string $appId + * @throws AppPathNotFoundException * @since 8.0.0 */ public function enableApp($appId); |