summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-06-17 18:44:37 +0200
committerGitHub <noreply@github.com>2020-06-17 18:44:37 +0200
commite64e2d66a6d5a595acc05986514eda503912aa55 (patch)
treedc20c4d32be6763acb539447c3c6614534f403c8
parent38cbd17e0a4387d9349a4926dfcc7c670bab0dfb (diff)
parent5bc8510b3b72cf4bc96614784110d88de8feea87 (diff)
downloadnextcloud-server-e64e2d66a6d5a595acc05986514eda503912aa55.tar.gz
nextcloud-server-e64e2d66a6d5a595acc05986514eda503912aa55.zip
Merge pull request #21456 from nextcloud/fix/bootstrap-appphp-order
Load the app.php before running apps' boot method
-rw-r--r--lib/private/legacy/OC_App.php7
-rw-r--r--lib/public/AppFramework/Bootstrap/IBootstrap.php7
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index a3c429c9ce4..85fd8c99f05 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -149,9 +149,6 @@ class OC_App {
// in case someone calls loadApp() directly
self::registerAutoloading($app, $appPath);
- /** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */
- $coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
- $coordinator->bootApp($app);
if (is_file($appPath . '/appinfo/app.php')) {
\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
try {
@@ -176,6 +173,10 @@ class OC_App {
\OC::$server->getEventLogger()->end('load_app_' . $app);
}
+ /** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */
+ $coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
+ $coordinator->bootApp($app);
+
$info = self::getAppInfo($app);
if (!empty($info['activity']['filters'])) {
foreach ($info['activity']['filters'] as $filter) {
diff --git a/lib/public/AppFramework/Bootstrap/IBootstrap.php b/lib/public/AppFramework/Bootstrap/IBootstrap.php
index 581c7d6636a..770c830e735 100644
--- a/lib/public/AppFramework/Bootstrap/IBootstrap.php
+++ b/lib/public/AppFramework/Bootstrap/IBootstrap.php
@@ -38,6 +38,13 @@ interface IBootstrap {
public function register(IRegistrationContext $context): void;
/**
+ * Boot the application
+ *
+ * At this stage you can assume that all services are registered and the DI
+ * container(s) are ready to be queried.
+ *
+ * This is also the state where an optional `appinfo/app.php` was loaded.
+ *
* @param IBootContext $context
*
* @since 20.0.0