Merge pull request #26878 from nextcloud/bugfix/noid/dont-break-occ-when-an-app-is-breaking-in-application-class
Don't break OCC if an app is breaking in it's Application class
This commit is contained in:
commit
4d82a9446d
|
@ -113,21 +113,24 @@ class Coordinator {
|
||||||
*/
|
*/
|
||||||
$appNameSpace = App::buildAppNamespace($appId);
|
$appNameSpace = App::buildAppNamespace($appId);
|
||||||
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
|
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
|
||||||
if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) {
|
try {
|
||||||
try {
|
if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) {
|
||||||
/** @var IBootstrap|App $application */
|
try {
|
||||||
$apps[$appId] = $application = $this->serverContainer->query($applicationClassName);
|
/** @var IBootstrap|App $application */
|
||||||
} catch (QueryException $e) {
|
$apps[$appId] = $application = $this->serverContainer->query($applicationClassName);
|
||||||
// Weird, but ok
|
} catch (QueryException $e) {
|
||||||
continue;
|
// Weird, but ok
|
||||||
}
|
continue;
|
||||||
try {
|
}
|
||||||
|
|
||||||
$application->register($this->registrationContext->for($appId));
|
$application->register($this->registrationContext->for($appId));
|
||||||
} catch (Throwable $e) {
|
|
||||||
$this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [
|
|
||||||
'exception' => $e,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
$this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [
|
||||||
|
'exception' => $e,
|
||||||
|
'app' => $appId,
|
||||||
|
]);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,14 @@ class OC_App {
|
||||||
ob_start();
|
ob_start();
|
||||||
foreach ($apps as $app) {
|
foreach ($apps as $app) {
|
||||||
if (!isset(self::$loadedApps[$app]) && ($types === [] || self::isType($app, $types))) {
|
if (!isset(self::$loadedApps[$app]) && ($types === [] || self::isType($app, $types))) {
|
||||||
self::loadApp($app);
|
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();
|
ob_end_clean();
|
||||||
|
|
Loading…
Reference in New Issue