Browse Source

Improve usage of IAppManager::getAppWebPath()

Deprecate \OC_App::getAppWebPath() and \OC_App::getAppPath()

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
pull/16859/head
Daniel Rudolf 6 years ago
parent
commit
2d56664e35
No known key found for this signature in database GPG Key ID: A061F02CD8DE4538
  1. 2
      lib/private/App/AppManager.php
  2. 2
      lib/private/legacy/app.php
  3. 4
      lib/public/App/IAppManager.php

2
lib/private/App/AppManager.php

@ -411,7 +411,7 @@ class AppManager implements IAppManager {
* @return string
* @throws AppPathNotFoundException if app path can't be found
*/
public function getAppWebPath($appId) {
public function getAppWebPath(string $appId): string {
$appWebPath = \OC_App::getAppWebPath($appId);
if($appWebPath === false) {
throw new AppPathNotFoundException('Could not find web path for ' . $appId);

2
lib/private/legacy/app.php

@ -485,6 +485,7 @@ class OC_App {
*
* @param string $appId
* @return string|false
* @deprecated 11.0.0 use \OC::$server->getAppManager()->getAppPath()
*/
public static function getAppPath(string $appId) {
if ($appId === null || trim($appId) === '') {
@ -503,6 +504,7 @@ class OC_App {
*
* @param string $appId
* @return string|false
* @deprecated 18.0.0 use \OC::$server->getAppManager()->getAppWebPath()
*/
public static function getAppWebPath(string $appId) {
if (($dir = self::findAppInDirectories($appId)) != false) {

4
lib/public/App/IAppManager.php

@ -131,10 +131,10 @@ interface IAppManager {
*
* @param string $appId
* @return string
* @since 17.0.0
* @since 18.0.0
* @throws AppPathNotFoundException
*/
public function getAppWebPath($appId);
public function getAppWebPath(string $appId): string;
/**
* List all apps enabled for a user

Loading…
Cancel
Save