Replace DI::config() with container

This commit is contained in:
Art4 2024-12-26 10:34:32 +00:00
parent 502d0d1b53
commit 81d28bbb4c

View file

@ -235,9 +235,12 @@ class App
$mode->setExecutor(Mode::DAEMON); $mode->setExecutor(Mode::DAEMON);
DI::config()->reload(); /** @var IManageConfigValues */
$config = $this->container->create(IManageConfigValues::class);
if (empty(DI::config()->get('system', 'pidfile'))) { $config->reload();
if (empty($config->get('system', 'pidfile'))) {
die(<<< TXT die(<<< TXT
Please set system.pidfile in config/local.config.php. For example: Please set system.pidfile in config/local.config.php. For example:
@ -248,7 +251,7 @@ class App
); );
} }
$pidfile = DI::config()->get('system', 'pidfile'); $pidfile = $config->get('system', 'pidfile');
if (in_array('start', $argv)) { if (in_array('start', $argv)) {
$mode = 'start'; $mode = 'start';
@ -358,7 +361,7 @@ class App
// Just to be sure that this script really runs endlessly // Just to be sure that this script really runs endlessly
set_time_limit(0); set_time_limit(0);
$wait_interval = intval(DI::config()->get('system', 'cron_interval', 5)) * 60; $wait_interval = intval($config->get('system', 'cron_interval', 5)) * 60;
$do_cron = true; $do_cron = true;
$last_cron = 0; $last_cron = 0;