Skip to content

Commit e64e2d6

Browse files
Merge pull request #21456 from nextcloud/fix/bootstrap-appphp-order
Load the app.php before running apps' boot method
2 parents 38cbd17 + 5bc8510 commit e64e2d6

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/private/legacy/OC_App.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ public static function loadApp(string $app) {
149149
// in case someone calls loadApp() directly
150150
self::registerAutoloading($app, $appPath);
151151

152-
/** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */
153-
$coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
154-
$coordinator->bootApp($app);
155152
if (is_file($appPath . '/appinfo/app.php')) {
156153
\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
157154
try {
@@ -176,6 +173,10 @@ public static function loadApp(string $app) {
176173
\OC::$server->getEventLogger()->end('load_app_' . $app);
177174
}
178175

176+
/** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */
177+
$coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
178+
$coordinator->bootApp($app);
179+
179180
$info = self::getAppInfo($app);
180181
if (!empty($info['activity']['filters'])) {
181182
foreach ($info['activity']['filters'] as $filter) {

lib/public/AppFramework/Bootstrap/IBootstrap.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ interface IBootstrap {
3838
public function register(IRegistrationContext $context): void;
3939

4040
/**
41+
* Boot the application
42+
*
43+
* At this stage you can assume that all services are registered and the DI
44+
* container(s) are ready to be queried.
45+
*
46+
* This is also the state where an optional `appinfo/app.php` was loaded.
47+
*
4148
* @param IBootContext $context
4249
*
4350
* @since 20.0.0

0 commit comments

Comments
 (0)