aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-02-08 12:35:57 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-03-20 10:21:45 +0100
commit78c17168185c21b6b788e40602f95c690fe441f9 (patch)
treeef53bbc85e48499a0e3e949f581b0e6e0c5b9565 /lib/private/legacy
parent8dc5f8218979a8bf05ac5a8e84649f750dcab5ec (diff)
downloadnextcloud-server-78c17168185c21b6b788e40602f95c690fe441f9.tar.gz
nextcloud-server-78c17168185c21b6b788e40602f95c690fe441f9.zip
Move loadApps to the 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.php35
1 files changed, 3 insertions, 32 deletions
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index ec57d43f9a6..5d7941ffa3f 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -116,40 +116,11 @@ class OC_App {
* if $types is set to non-empty array, only apps of those types will be loaded
*/
public static function loadApps(array $types = []): bool {
- if ((bool) \OC::$server->getSystemConfig()->getValue('maintenance', false)) {
+ if (!\OC::$server->getSystemConfig()->getValue('installed', false)) {
+ // This should be done before calling this method so that appmanager can be used
return false;
}
- // Load the enabled apps here
- $apps = self::getEnabledApps();
-
- // Add each apps' folder as allowed class path
- foreach ($apps as $app) {
- // If the app is already loaded then autoloading it makes no sense
- if (!self::isAppLoaded($app)) {
- $path = self::getAppPath($app);
- if ($path !== false) {
- self::registerAutoloading($app, $path);
- }
- }
- }
-
- // prevent app.php from printing output
- ob_start();
- foreach ($apps as $app) {
- if (!self::isAppLoaded($app) && ($types === [] || self::isType($app, $types))) {
- try {
- self::loadApp($app);
- } catch (\Throwable $e) {
- \OC::$server->get(LoggerInterface::class)->emergency('Error during app loading: ' . $e->getMessage(), [
- 'exception' => $e,
- 'app' => $app,
- ]);
- }
- }
- }
- ob_end_clean();
-
- return true;
+ return \OC::$server->get(IAppManager::class)->loadApps($types);
}
/**