|
|
|
@ -20,6 +20,7 @@ use OCP\Dashboard\IManager; |
|
|
|
use OCP\Diagnostics\IEventLogger; |
|
|
|
use OCP\EventDispatcher\IEventDispatcher; |
|
|
|
use OCP\IServerContainer; |
|
|
|
use Psr\Container\ContainerExceptionInterface; |
|
|
|
use Psr\Log\LoggerInterface; |
|
|
|
use Throwable; |
|
|
|
use function class_exists; |
|
|
|
@ -69,19 +70,24 @@ class Coordinator { |
|
|
|
*/ |
|
|
|
try { |
|
|
|
$path = $this->appManager->getAppPath($appId); |
|
|
|
OC_App::registerAutoloading($appId, $path); |
|
|
|
} catch (AppPathNotFoundException) { |
|
|
|
// Ignore
|
|
|
|
continue; |
|
|
|
} |
|
|
|
OC_App::registerAutoloading($appId, $path); |
|
|
|
$this->eventLogger->end("bootstrap:register_app:$appId:autoloader"); |
|
|
|
|
|
|
|
/* |
|
|
|
* Next we check if there is an application class, and it implements |
|
|
|
* the \OCP\AppFramework\Bootstrap\IBootstrap interface |
|
|
|
*/ |
|
|
|
$appNameSpace = App::buildAppNamespace($appId); |
|
|
|
if ($appId === 'core') { |
|
|
|
$appNameSpace = 'OC\\Core'; |
|
|
|
} else { |
|
|
|
$appNameSpace = App::buildAppNamespace($appId); |
|
|
|
} |
|
|
|
$applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
|
|
|
|
|
|
try { |
|
|
|
if (class_exists($applicationClassName) && is_a($applicationClassName, IBootstrap::class, true)) { |
|
|
|
$this->eventLogger->start("bootstrap:register_app:$appId:application", "Load `Application` instance for $appId"); |
|
|
|
@ -89,7 +95,7 @@ class Coordinator { |
|
|
|
/** @var IBootstrap&App $application */ |
|
|
|
$application = $this->serverContainer->query($applicationClassName); |
|
|
|
$apps[$appId] = $application; |
|
|
|
} catch (QueryException $e) { |
|
|
|
} catch (ContainerExceptionInterface $e) { |
|
|
|
// Weird, but ok
|
|
|
|
$this->eventLogger->end("bootstrap:register_app:$appId"); |
|
|
|
continue; |
|
|
|
|