mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Small cleanups for AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
78c1716818
commit
13c71ed24a
3 changed files with 6 additions and 3 deletions
|
|
@ -237,7 +237,7 @@ class AppManager implements IAppManager {
|
|||
public function isType(string $app, array $types): bool {
|
||||
$appTypes = $this->getAppTypes($app);
|
||||
foreach ($types as $type) {
|
||||
if (array_search($type, $appTypes) !== false) {
|
||||
if (in_array($type, $appTypes, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ class AppManager implements IAppManager {
|
|||
private function getAppTypes(string $app): array {
|
||||
//load the cache
|
||||
if (count($this->appTypes) === 0) {
|
||||
$this->appTypes = \OC::$server->getAppConfig()->getValues(false, 'types');
|
||||
$this->appTypes = $this->appConfig->getValues(false, 'types') ?: [];
|
||||
}
|
||||
|
||||
if (isset($this->appTypes[$app])) {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ class OC_App {
|
|||
*
|
||||
* @param string $app
|
||||
* @return bool
|
||||
* @deprecated 26.0.0 use IAppManager::isAppLoaded
|
||||
*/
|
||||
public static function isAppLoaded(string $app): bool {
|
||||
return \OC::$server->get(IAppManager::class)->isAppLoaded($app);
|
||||
|
|
@ -128,6 +129,7 @@ class OC_App {
|
|||
*
|
||||
* @param string $app
|
||||
* @throws Exception
|
||||
* @deprecated 26.0.0 use IAppManager::loadApp
|
||||
*/
|
||||
public static function loadApp(string $app): void {
|
||||
\OC::$server->get(IAppManager::class)->loadApp($app);
|
||||
|
|
@ -169,7 +171,7 @@ class OC_App {
|
|||
* @param string $app
|
||||
* @param array $types
|
||||
* @return bool
|
||||
* @deprecated 26.0.0 call \OC::$server->get(IAppManager::class)->isType($app, $types)
|
||||
* @deprecated 26.0.0 use IAppManager::isType
|
||||
*/
|
||||
public static function isType(string $app, array $types): bool {
|
||||
return \OC::$server->get(IAppManager::class)->isType($app, $types);
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ interface IAppManager {
|
|||
* exists.
|
||||
*
|
||||
* if $types is set to non-empty array, only apps of those types will be loaded
|
||||
* @since 26.0.0
|
||||
*/
|
||||
public function loadApps(array $types = []): bool;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue