Apply Update::check() suggestions

This commit is contained in:
Philipp Holzer 2023-01-06 12:50:14 +01:00
parent c35fd68ec2
commit baf3225916
Signed by: nupplaPhil
GPG Key ID: 24A7501396EB5432
6 changed files with 5 additions and 9 deletions

View File

@ -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);

View File

@ -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");
}

View File

@ -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)) {

View File

@ -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();

View File

@ -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();
}

View File

@ -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;