diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-02-08 11:46:07 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-03-20 10:21:45 +0100 |
commit | 8dc5f8218979a8bf05ac5a8e84649f750dcab5ec (patch) | |
tree | 37694ee2e6dac5673f12246e0e325bd77b837560 /lib/private/legacy | |
parent | 633ea018af94692cef8a196319f79eaf2467f061 (diff) | |
download | nextcloud-server-8dc5f8218979a8bf05ac5a8e84649f750dcab5ec.tar.gz nextcloud-server-8dc5f8218979a8bf05ac5a8e84649f750dcab5ec.zip |
Move isType to AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_App.php | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 01bce057881..ec57d43f9a6 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -75,7 +75,6 @@ use Psr\Log\LoggerInterface; class OC_App { private static $adminForms = []; private static $personalForms = []; - private static $appTypes = []; private static $altLogin = []; private static $alreadyRegistered = []; public const supportedApp = 300; @@ -199,34 +198,10 @@ class OC_App { * @param string $app * @param array $types * @return bool + * @deprecated 26.0.0 call \OC::$server->get(IAppManager::class)->isType($app, $types) */ public static function isType(string $app, array $types): bool { - $appTypes = self::getAppTypes($app); - foreach ($types as $type) { - if (array_search($type, $appTypes) !== false) { - return true; - } - } - return false; - } - - /** - * get the types of an app - * - * @param string $app - * @return array - */ - private static function getAppTypes(string $app): array { - //load the cache - if (count(self::$appTypes) == 0) { - self::$appTypes = \OC::$server->getAppConfig()->getValues(false, 'types'); - } - - if (isset(self::$appTypes[$app])) { - return explode(',', self::$appTypes[$app]); - } - - return []; + return \OC::$server->get(IAppManager::class)->isType($app, $types); } /** |