$this->logger->logException($e, [
'message' => "Could not boot $appId" . $e->getMessage(),
]);
- return;
} catch (Throwable $e) {
$this->logger->logException($e, [
'message' => "Could not boot $appId" . $e->getMessage(),
]);
}
}
+
+ public function isBootable(string $appId) {
+ $appNameSpace = App::buildAppNamespace($appId);
+ $applicationClassName = $appNameSpace . '\\AppInfo\\Application';
+ return class_exists($applicationClassName) &&
+ in_array(IBootstrap::class, class_implements($applicationClassName), true);
+ }
}
// in case someone calls loadApp() directly
self::registerAutoloading($app, $appPath);
- if (is_file($appPath . '/appinfo/app.php')) {
+ /** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */
+ $coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
+ $isBootable = $coordinator->isBootable($app);
+
+ $hasAppPhpFile = is_file($appPath . '/appinfo/app.php');
+
+ if ($isBootable && $hasAppPhpFile) {
+ \OC::$server->getLogger()->error('/appinfo/app.php is not loaded when \OCP\AppFramework\Bootstrap\IBootstrap on the application class is used. Migrate everything from app.php to the Application class.', [
+ 'app' => $app,
+ ]);
+ } elseif ($hasAppPhpFile) {
\OC::$server->getLogger()->debug('/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.', [
'app' => $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);