diff options
author | Daniel Rudolf <github.com@daniel-rudolf.de> | 2019-08-25 15:27:04 +0200 |
---|---|---|
committer | Daniel Rudolf <github.com@daniel-rudolf.de> | 2019-08-25 15:27:04 +0200 |
commit | 34919d3ebc828314579d180a5ab261b67e6fc03c (patch) | |
tree | be9d8fd93ab58b5cff1899e821c7b547ec226253 /lib | |
parent | a4e6073e47b1574c4dd9342bde1601ece28bdb3c (diff) | |
download | nextcloud-server-34919d3ebc828314579d180a5ab261b67e6fc03c.tar.gz nextcloud-server-34919d3ebc828314579d180a5ab261b67e6fc03c.zip |
Add IAppManager::getAppWebPath()
Implements a public API for \OC_App::getAppWebPath()
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppManager.php | 16 | ||||
-rw-r--r-- | lib/public/App/IAppManager.php | 11 |
2 files changed, 27 insertions, 0 deletions
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 <robin@icewind.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> + * @author Daniel Rudolf <nextcloud.com@daniel-rudolf.de> * * @license AGPL-3.0 * @@ -404,6 +405,21 @@ class AppManager implements IAppManager { } /** + * 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 */ public function clearAppsCache() { diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index aebd47b3a2d..c57b94382a7 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -8,6 +8,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Daniel Rudolf <nextcloud.com@daniel-rudolf.de> * * @license AGPL-3.0 * @@ -126,6 +127,16 @@ interface IAppManager { public function getAppPath($appId); /** + * Get the web path for the given app. + * + * @param string $appId + * @return string + * @since 17.0.0 + * @throws AppPathNotFoundException + */ + public function getAppWebPath($appId); + + /** * List all apps enabled for a user * * @param \OCP\IUser $user |