From 34919d3ebc828314579d180a5ab261b67e6fc03c Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 25 Aug 2019 15:27:04 +0200 Subject: Add IAppManager::getAppWebPath() Implements a public API for \OC_App::getAppWebPath() Signed-off-by: Daniel Rudolf --- lib/private/App/AppManager.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/private/App') diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 322731d677c..6571386f5cf 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -13,6 +13,7 @@ * @author Robin Appelman * @author Thomas Müller * @author Vincent Petry + * @author Daniel Rudolf * * @license AGPL-3.0 * @@ -403,6 +404,21 @@ class AppManager implements IAppManager { return $appPath; } + /** + * Get the web path for the given app. + * + * @param string $appId + * @return string + * @throws AppPathNotFoundException if app path can't be found + */ + public function getAppWebPath($appId) { + $appWebPath = \OC_App::getAppWebPath($appId); + if($appWebPath === false) { + throw new AppPathNotFoundException('Could not find web path for ' . $appId); + } + return $appWebPath; + } + /** * Clear the cached list of apps when enabling/disabling an app */ -- cgit v1.2.3