aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-02-07 17:01:13 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-03-20 10:17:28 +0100
commit71ed968e34b595bd515db29c25a3af32901cf97c (patch)
treed2dcc1870594af778bb359ea95fee9704be733c1 /lib/private/App
parenta7c8090dc3c47c79ed9e7e22967cba7d124f0fa7 (diff)
downloadnextcloud-server-71ed968e34b595bd515db29c25a3af32901cf97c.tar.gz
nextcloud-server-71ed968e34b595bd515db29c25a3af32901cf97c.zip
Switch away from Server::get for AppManager and logger in loadApp
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppManager.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index 0b0bcecb5dc..0ee8dccaeb7 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -338,12 +338,12 @@ class AppManager implements IAppManager {
$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.', [
+ $this->logger->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) {
$eventLogger->start("bootstrap:load_app:$app:app.php", "Load legacy app.php app $app");
- \OC::$server->getLogger()->debug('/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.', [
+ $this->logger->debug('/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.', [
'app' => $app,
]);
try {
@@ -352,16 +352,16 @@ class AppManager implements IAppManager {
if ($ex instanceof ServerNotAvailableException) {
throw $ex;
}
- if (!\OC::$server->getAppManager()->isShipped($app) && !self::isType($app, ['authentication'])) {
- \OC::$server->getLogger()->logException($ex, [
- 'message' => "App $app threw an error during app.php load and will be disabled: " . $ex->getMessage(),
+ if (!$this->isShipped($app) && !\OC_App::isType($app, ['authentication'])) {
+ $this->logger->error("App $app threw an error during app.php load and will be disabled: " . $ex->getMessage(), [
+ 'exception' => $ex,
]);
// Only disable apps which are not shipped and that are not authentication apps
- \OC::$server->getAppManager()->disableApp($app, true);
+ $this->disableApp($app, true);
} else {
- \OC::$server->getLogger()->logException($ex, [
- 'message' => "App $app threw an error during app.php load: " . $ex->getMessage(),
+ $this->logger->error("App $app threw an error during app.php load: " . $ex->getMessage(), [
+ 'exception' => $ex,
]);
}
}