Apply Update::check() suggestions
This commit is contained in:
parent
c35fd68ec2
commit
baf3225916
6 changed files with 5 additions and 9 deletions
|
@ -84,7 +84,7 @@ $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabb
|
||||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
||||||
|
|
||||||
// Check the database structure and possibly fixes it
|
// 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);
|
$appMode = $dice->create(Mode::class);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ if (php_sapi_name() !== 'cli') {
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Update;
|
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -65,9 +64,6 @@ $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['daemon']])
|
||||||
DI::init($dice);
|
DI::init($dice);
|
||||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
\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()) {
|
if (DI::mode()->isInstall()) {
|
||||||
die("Friendica isn't properly installed yet.\n");
|
die("Friendica isn't properly installed yet.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ DI::init($dice);
|
||||||
DI::mode()->setExecutor(Mode::WORKER);
|
DI::mode()->setExecutor(Mode::WORKER);
|
||||||
|
|
||||||
// Check the database structure and possibly fixes it
|
// Check the database structure and possibly fixes it
|
||||||
Update::check(DI::basePath(), true, DI::mode());
|
Update::check(DI::basePath(), true);
|
||||||
|
|
||||||
// Quit when in maintenance
|
// Quit when in maintenance
|
||||||
if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
|
if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
|
||||||
|
|
|
@ -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));
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
||||||
|
|
||||||
// Check the database structure and possibly fixes it
|
// 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();
|
$a = \Friendica\DI::app();
|
||||||
|
|
||||||
|
|
|
@ -659,7 +659,7 @@ class App
|
||||||
$this->baseURL->redirect('install');
|
$this->baseURL->redirect('install');
|
||||||
} else {
|
} else {
|
||||||
$this->checkURL();
|
$this->checkURL();
|
||||||
Core\Update::check($this->getBasePath(), false, $this->mode);
|
Core\Update::check($this->getBasePath(), false);
|
||||||
Core\Addon::loadAddons();
|
Core\Addon::loadAddons();
|
||||||
Core\Hook::loadHooks();
|
Core\Hook::loadHooks();
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Update
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @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()) {
|
if (!DBA::connected()) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue