From baf3225916dc44cca95aaf5a6c2d73b1a037b90a Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 6 Jan 2023 12:50:14 +0100 Subject: [PATCH] Apply Update::check() suggestions --- bin/auth_ejabberd.php | 2 +- bin/daemon.php | 4 ---- bin/worker.php | 2 +- index.php | 2 +- src/App.php | 2 +- src/Core/Update.php | 2 +- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/auth_ejabberd.php b/bin/auth_ejabberd.php index 9c5dc0528..40e7d3b97 100755 --- a/bin/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -84,7 +84,7 @@ $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabb \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); // Check the database structure and possibly fixes it -\Friendica\Core\Update::check(\Friendica\DI::basePath(), true, \Friendica\DI::mode()); +\Friendica\Core\Update::check(\Friendica\DI::basePath(), true); $appMode = $dice->create(Mode::class); diff --git a/bin/daemon.php b/bin/daemon.php index 6237df49d..b970f4a75 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -33,7 +33,6 @@ if (php_sapi_name() !== 'cli') { use Dice\Dice; use Friendica\App\Mode; use Friendica\Core\Logger; -use Friendica\Core\Update; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; @@ -65,9 +64,6 @@ $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['daemon']]) DI::init($dice); \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); -// Check the database structure and possibly fixes it -Update::check(DI::basePath(), true, DI::mode()); - if (DI::mode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); } diff --git a/bin/worker.php b/bin/worker.php index aceeff481..de207ae98 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -62,7 +62,7 @@ DI::init($dice); DI::mode()->setExecutor(Mode::WORKER); // Check the database structure and possibly fixes it -Update::check(DI::basePath(), true, DI::mode()); +Update::check(DI::basePath(), true); // Quit when in maintenance if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { diff --git a/index.php b/index.php index 10f04996a..e0f33666b 100644 --- a/index.php +++ b/index.php @@ -37,7 +37,7 @@ $dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); // Check the database structure and possibly fixes it -\Friendica\Core\Update::check(\Friendica\DI::basePath(), true, \Friendica\DI::mode()); +\Friendica\Core\Update::check(\Friendica\DI::basePath(), true); $a = \Friendica\DI::app(); diff --git a/src/App.php b/src/App.php index fc70f920d..224a895e2 100644 --- a/src/App.php +++ b/src/App.php @@ -659,7 +659,7 @@ class App $this->baseURL->redirect('install'); } else { $this->checkURL(); - Core\Update::check($this->getBasePath(), false, $this->mode); + Core\Update::check($this->getBasePath(), false); Core\Addon::loadAddons(); Core\Hook::loadHooks(); } diff --git a/src/Core/Update.php b/src/Core/Update.php index 03badb1b5..eb207b6c2 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -47,7 +47,7 @@ class Update * @return void * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function check(string $basePath, bool $via_worker, App\Mode $mode) + public static function check(string $basePath, bool $via_worker) { if (!DBA::connected()) { return;