|
20 | 20 | use OCP\Diagnostics\IEventLogger; |
21 | 21 | use OCP\EventDispatcher\IEventDispatcher; |
22 | 22 | use OCP\IServerContainer; |
| 23 | +use Psr\Container\ContainerExceptionInterface; |
23 | 24 | use Psr\Log\LoggerInterface; |
24 | 25 | use Throwable; |
25 | 26 | use function class_exists; |
@@ -69,27 +70,32 @@ private function registerApps(array $appIds): void { |
69 | 70 | */ |
70 | 71 | try { |
71 | 72 | $path = $this->appManager->getAppPath($appId); |
| 73 | + OC_App::registerAutoloading($appId, $path); |
72 | 74 | } catch (AppPathNotFoundException) { |
73 | 75 | // Ignore |
74 | 76 | continue; |
75 | 77 | } |
76 | | - OC_App::registerAutoloading($appId, $path); |
77 | 78 | $this->eventLogger->end("bootstrap:register_app:$appId:autoloader"); |
78 | 79 |
|
79 | 80 | /* |
80 | 81 | * Next we check if there is an application class, and it implements |
81 | 82 | * the \OCP\AppFramework\Bootstrap\IBootstrap interface |
82 | 83 | */ |
83 | | - $appNameSpace = App::buildAppNamespace($appId); |
| 84 | + if ($appId === 'core') { |
| 85 | + $appNameSpace = 'OC\\Core'; |
| 86 | + } else { |
| 87 | + $appNameSpace = App::buildAppNamespace($appId); |
| 88 | + } |
84 | 89 | $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
| 90 | + |
85 | 91 | try { |
86 | 92 | if (class_exists($applicationClassName) && is_a($applicationClassName, IBootstrap::class, true)) { |
87 | 93 | $this->eventLogger->start("bootstrap:register_app:$appId:application", "Load `Application` instance for $appId"); |
88 | 94 | try { |
89 | 95 | /** @var IBootstrap&App $application */ |
90 | 96 | $application = $this->serverContainer->query($applicationClassName); |
91 | 97 | $apps[$appId] = $application; |
92 | | - } catch (QueryException $e) { |
| 98 | + } catch (ContainerExceptionInterface $e) { |
93 | 99 | // Weird, but ok |
94 | 100 | $this->eventLogger->end("bootstrap:register_app:$appId"); |
95 | 101 | continue; |
|
0 commit comments