diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-11-17 22:39:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-17 22:39:34 +0100 |
commit | d3900fc0d520e2cc7345beb42e61ec7da6944813 (patch) | |
tree | e0a19dcd1dddfe334816f99f5c32317644aa6906 /lib/private | |
parent | 82141faea19090cde11b7f1a1ece10a0a3d79991 (diff) | |
parent | caacb6c261140cd8f86ba5e430d2d9af217eae45 (diff) | |
download | nextcloud-server-d3900fc0d520e2cc7345beb42e61ec7da6944813.tar.gz nextcloud-server-d3900fc0d520e2cc7345beb42e61ec7da6944813.zip |
Merge pull request #2177 from nextcloud/appmanager-getapppath
Expose getAppPath to public API
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/App/AppManager.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 55fd575e129..fca5c9b87ac 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -31,6 +31,7 @@ namespace OC\App; +use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; use OCP\App\ManagerEvent; use OCP\IAppConfig; @@ -266,6 +267,21 @@ class AppManager implements IAppManager { } /** + * Get the directory for the given app. + * + * @param string $appId + * @return string + * @throws AppPathNotFoundException if app folder can't be found + */ + public function getAppPath($appId) { + $appPath = \OC_App::getAppPath($appId); + if($appPath === false) { + throw new AppPathNotFoundException('Could not find path for ' . $appId); + } + return $appPath; + } + + /** * Clear the cached list of apps when enabling/disabling an app */ public function clearAppsCache() { |