From 0cd2b8e2c0882eb9aa0b289d02d51a2ff42ddd14 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:05:50 +0000 Subject: [PATCH 01/26] Refactor chdir() call --- bin/daemon.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index 6b62039ee7..dcb668acd6 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -33,16 +33,7 @@ $longopts = ['foreground']; $options = getopt($shortopts, $longopts); // Ensure that daemon.php is executed from the base path of the installation -if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) { - $directory = dirname($_SERVER['argv'][0]); - - if (substr($directory, 0, 1) != '/') { - $directory = $_SERVER['PWD'] . '/' . $directory; - } - $directory = realpath($directory . '/..'); - - chdir($directory); -} +chdir(dirname(__DIR__)); require dirname(__DIR__) . '/vendor/autoload.php'; From 341f5b46f6aba2104e40586ff30391aa6f087d70 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:24:12 +0000 Subject: [PATCH 02/26] refactor getopt() call --- bin/daemon.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index dcb668acd6..ef9e452647 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -28,9 +28,7 @@ use Friendica\Util\DateTimeFormat; use Psr\Log\LoggerInterface; // Get options -$shortopts = 'f'; -$longopts = ['foreground']; -$options = getopt($shortopts, $longopts); +$options = getopt('f', ['foreground']); // Ensure that daemon.php is executed from the base path of the installation chdir(dirname(__DIR__)); From 287e50f81a987002af25a870a1a097c6d91c9cd3 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:26:23 +0000 Subject: [PATCH 03/26] require the dependencies.config.php file --- bin/daemon.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/daemon.php b/bin/daemon.php index ef9e452647..caa32f123d 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -35,7 +35,8 @@ chdir(dirname(__DIR__)); require dirname(__DIR__) . '/vendor/autoload.php'; -$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php')); + /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ $addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); From 4348b0b8737b4da7cfc87ebe73b50a1eb84a43b2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:30:44 +0000 Subject: [PATCH 04/26] Move daemon code into anonymous function --- bin/daemon.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/daemon.php b/bin/daemon.php index caa32f123d..40297b3589 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -37,6 +37,7 @@ require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php')); +(function (Dice $dice, array $options): void { /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ $addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); @@ -230,6 +231,7 @@ while (true) { Logger::info('Worker jobs are calling to be forked.', ['pid' => $pid]); } } +})($dice, $options); function shutdown() { posix_kill(posix_getpid(), SIGTERM); From d8509b426d1491db9a057f90817a15e5209ff769 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:31:36 +0000 Subject: [PATCH 05/26] Register shutdown function as anonymous function --- bin/daemon.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index 40297b3589..d8e47e78c5 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -153,7 +153,10 @@ if (!$foreground) { } // We now are in the child process - register_shutdown_function('shutdown'); + register_shutdown_function(function () { + posix_kill(posix_getpid(), SIGTERM); + posix_kill(posix_getpid(), SIGHUP); + }); // Make the child the main process, detach it from the terminal if (posix_setsid() < 0) { @@ -232,8 +235,3 @@ while (true) { } } })($dice, $options); - -function shutdown() { - posix_kill(posix_getpid(), SIGTERM); - posix_kill(posix_getpid(), SIGHUP); -} From bac5f00190493dc017a8a05abe15f914b3d919df Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:07:03 +0000 Subject: [PATCH 06/26] Move daemon.php code into App::processDaemon() method --- bin/daemon.php | 207 +----------------------------------------------- src/App.php | 209 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 210 insertions(+), 206 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index d8e47e78c5..5242d9bf4e 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -18,14 +18,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; -use Friendica\Util\DateTimeFormat; -use Psr\Log\LoggerInterface; // Get options $options = getopt('f', ['foreground']); @@ -37,201 +29,6 @@ require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php')); -(function (Dice $dice, array $options): void { -/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ -$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); -$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); -$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]); +$app = \Friendica\App::fromDice($dice); -DI::init($dice); -\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); - -if (DI::mode()->isInstall()) { - die("Friendica isn't properly installed yet.\n"); -} - -DI::mode()->setExecutor(Mode::DAEMON); - -DI::config()->reload(); - -if (empty(DI::config()->get('system', 'pidfile'))) { - die(<< [ - 'pidfile' => '/path/to/daemon.pid', - ], -TXT - ); -} - -$pidfile = DI::config()->get('system', 'pidfile'); - -if (in_array('start', $_SERVER['argv'])) { - $mode = 'start'; -} - -if (in_array('stop', $_SERVER['argv'])) { - $mode = 'stop'; -} - -if (in_array('status', $_SERVER['argv'])) { - $mode = 'status'; -} - -$foreground = array_key_exists('f', $options) || array_key_exists('foreground', $options); - -if (!isset($mode)) { - die("Please use either 'start', 'stop' or 'status'.\n"); -} - -if (empty($_SERVER['argv'][0])) { - die("Unexpected script behaviour. This message should never occur.\n"); -} - -$pid = null; - -if (is_readable($pidfile)) { - $pid = intval(file_get_contents($pidfile)); -} - -if (empty($pid) && in_array($mode, ['stop', 'status'])) { - DI::keyValue()->set('worker_daemon_mode', false); - die("Pidfile wasn't found. Is the daemon running?\n"); -} - -if ($mode == 'status') { - if (posix_kill($pid, 0)) { - die("Daemon process $pid is running.\n"); - } - - unlink($pidfile); - - DI::keyValue()->set('worker_daemon_mode', false); - die("Daemon process $pid isn't running.\n"); -} - -if ($mode == 'stop') { - posix_kill($pid, SIGTERM); - - unlink($pidfile); - - Logger::notice('Worker daemon process was killed', ['pid' => $pid]); - - DI::keyValue()->set('worker_daemon_mode', false); - die("Worker daemon process $pid was killed.\n"); -} - -if (!empty($pid) && posix_kill($pid, 0)) { - die("Daemon process $pid is already running.\n"); -} - -Logger::notice('Starting worker daemon.', ['pid' => $pid]); - -if (!$foreground) { - echo "Starting worker daemon.\n"; - - DBA::disconnect(); - - // Fork a daemon process - $pid = pcntl_fork(); - if ($pid == -1) { - echo "Daemon couldn't be forked.\n"; - Logger::warning('Could not fork daemon'); - exit(1); - } elseif ($pid) { - // The parent process continues here - if (!file_put_contents($pidfile, $pid)) { - echo "Pid file wasn't written.\n"; - Logger::warning('Could not store pid file'); - posix_kill($pid, SIGTERM); - exit(1); - } - echo 'Child process started with pid ' . $pid . ".\n"; - Logger::notice('Child process started', ['pid' => $pid]); - exit(0); - } - - // We now are in the child process - register_shutdown_function(function () { - posix_kill(posix_getpid(), SIGTERM); - posix_kill(posix_getpid(), SIGHUP); - }); - - // Make the child the main process, detach it from the terminal - if (posix_setsid() < 0) { - return; - } - - // Closing all existing connections with the outside - fclose(STDIN); - - // And now connect the database again - DBA::connect(); -} - -DI::keyValue()->set('worker_daemon_mode', true); - -// Just to be sure that this script really runs endlessly -set_time_limit(0); - -$wait_interval = intval(DI::config()->get('system', 'cron_interval', 5)) * 60; - -$do_cron = true; -$last_cron = 0; - -// Now running as a daemon. -while (true) { - // Check the database structure and possibly fixes it - Update::check(DI::basePath(), true); - - if (!$do_cron && ($last_cron + $wait_interval) < time()) { - Logger::info('Forcing cron worker call.', ['pid' => $pid]); - $do_cron = true; - } - - if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) { - Worker::spawnWorker($do_cron); - } else { - Logger::info('Cool down for 5 seconds', ['pid' => $pid]); - sleep(5); - } - - if ($do_cron) { - // We force a reconnect of the database connection. - // This is done to ensure that the connection don't get lost over time. - DBA::reconnect(); - - $last_cron = time(); - } - - $start = time(); - Logger::info('Sleeping', ['pid' => $pid, 'until' => gmdate(DateTimeFormat::MYSQL, $start + $wait_interval)]); - - do { - $seconds = (time() - $start); - - // logarithmic wait time calculation. - // Background: After jobs had been started, they often fork many workers. - // To not waste too much time, the sleep period increases. - $arg = (($seconds + 1) / ($wait_interval / 9)) + 1; - $sleep = min(1000000, round(log10($arg) * 1000000, 0)); - usleep($sleep); - - $pid = pcntl_waitpid(-1, $status, WNOHANG); - if ($pid > 0) { - Logger::info('Children quit via pcntl_waitpid', ['pid' => $pid, 'status' => $status]); - } - - $timeout = ($seconds >= $wait_interval); - } while (!$timeout && !Worker\IPC::JobsExists()); - - if ($timeout) { - $do_cron = true; - Logger::info('Woke up after $wait_interval seconds.', ['pid' => $pid, 'sleep' => $wait_interval]); - } else { - $do_cron = false; - Logger::info('Worker jobs are calling to be forked.', ['pid' => $pid]); - } -} -})($dice, $options); +$app->processDaemon($options); diff --git a/src/App.php b/src/App.php index 0fcebd464a..7a8acd39c1 100644 --- a/src/App.php +++ b/src/App.php @@ -19,15 +19,20 @@ use Friendica\Content\Nav; use Friendica\Core\Config\Factory\Config; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleUserSessions; +use Friendica\Database\DBA; use Friendica\Database\Definition\DbaDefinition; use Friendica\Database\Definition\ViewDefinition; +use Friendica\DI; use Friendica\Module\Maintenance; use Friendica\Security\Authentication; use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Core\L10n; +use Friendica\Core\Logger; use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; -use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Core\Update; +use Friendica\Core\Worker; use Friendica\Module\Special\HTTPException as ModuleHTTPException; use Friendica\Network\HTTPException; use Friendica\Protocol\ATProtocol\DID; @@ -40,6 +45,8 @@ use Friendica\Util\Profiler; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; + + /** * Our main application structure for the life of this page. * @@ -209,6 +216,206 @@ class App (new \Friendica\Core\Console($this->container, $argv))->execute(); } + public function processDaemon(array $options): void + { + /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ + $addonLoader = $this->container->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); + $this->container = $this->container->addRules($addonLoader->getActiveAddonConfig('dependencies')); + $this->container = $this->container->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]); + + DI::init($this->container); + \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(\Psr\Log\LoggerInterface::class)); + + if (DI::mode()->isInstall()) { + die("Friendica isn't properly installed yet.\n"); + } + + DI::mode()->setExecutor(Mode::DAEMON); + + DI::config()->reload(); + + if (empty(DI::config()->get('system', 'pidfile'))) { + die(<< [ + 'pidfile' => '/path/to/daemon.pid', + ], + TXT + ); + } + + $pidfile = DI::config()->get('system', 'pidfile'); + + if (in_array('start', $_SERVER['argv'])) { + $mode = 'start'; + } + + if (in_array('stop', $_SERVER['argv'])) { + $mode = 'stop'; + } + + if (in_array('status', $_SERVER['argv'])) { + $mode = 'status'; + } + + $foreground = array_key_exists('f', $options) || array_key_exists('foreground', $options); + + if (!isset($mode)) { + die("Please use either 'start', 'stop' or 'status'.\n"); + } + + if (empty($_SERVER['argv'][0])) { + die("Unexpected script behaviour. This message should never occur.\n"); + } + + $pid = null; + + if (is_readable($pidfile)) { + $pid = intval(file_get_contents($pidfile)); + } + + if (empty($pid) && in_array($mode, ['stop', 'status'])) { + DI::keyValue()->set('worker_daemon_mode', false); + die("Pidfile wasn't found. Is the daemon running?\n"); + } + + if ($mode == 'status') { + if (posix_kill($pid, 0)) { + die("Daemon process $pid is running.\n"); + } + + unlink($pidfile); + + DI::keyValue()->set('worker_daemon_mode', false); + die("Daemon process $pid isn't running.\n"); + } + + if ($mode == 'stop') { + posix_kill($pid, SIGTERM); + + unlink($pidfile); + + Logger::notice('Worker daemon process was killed', ['pid' => $pid]); + + DI::keyValue()->set('worker_daemon_mode', false); + die("Worker daemon process $pid was killed.\n"); + } + + if (!empty($pid) && posix_kill($pid, 0)) { + die("Daemon process $pid is already running.\n"); + } + + Logger::notice('Starting worker daemon.', ['pid' => $pid]); + + if (!$foreground) { + echo "Starting worker daemon.\n"; + + DBA::disconnect(); + + // Fork a daemon process + $pid = pcntl_fork(); + if ($pid == -1) { + echo "Daemon couldn't be forked.\n"; + Logger::warning('Could not fork daemon'); + exit(1); + } elseif ($pid) { + // The parent process continues here + if (!file_put_contents($pidfile, $pid)) { + echo "Pid file wasn't written.\n"; + Logger::warning('Could not store pid file'); + posix_kill($pid, SIGTERM); + exit(1); + } + echo 'Child process started with pid ' . $pid . ".\n"; + Logger::notice('Child process started', ['pid' => $pid]); + exit(0); + } + + // We now are in the child process + register_shutdown_function(function () { + posix_kill(posix_getpid(), SIGTERM); + posix_kill(posix_getpid(), SIGHUP); + }); + + // Make the child the main process, detach it from the terminal + if (posix_setsid() < 0) { + return; + } + + // Closing all existing connections with the outside + fclose(STDIN); + + // And now connect the database again + DBA::connect(); + } + + DI::keyValue()->set('worker_daemon_mode', true); + + // Just to be sure that this script really runs endlessly + set_time_limit(0); + + $wait_interval = intval(DI::config()->get('system', 'cron_interval', 5)) * 60; + + $do_cron = true; + $last_cron = 0; + + // Now running as a daemon. + while (true) { + // Check the database structure and possibly fixes it + Update::check(DI::basePath(), true); + + if (!$do_cron && ($last_cron + $wait_interval) < time()) { + Logger::info('Forcing cron worker call.', ['pid' => $pid]); + $do_cron = true; + } + + if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) { + Worker::spawnWorker($do_cron); + } else { + Logger::info('Cool down for 5 seconds', ['pid' => $pid]); + sleep(5); + } + + if ($do_cron) { + // We force a reconnect of the database connection. + // This is done to ensure that the connection don't get lost over time. + DBA::reconnect(); + + $last_cron = time(); + } + + $start = time(); + Logger::info('Sleeping', ['pid' => $pid, 'until' => gmdate(DateTimeFormat::MYSQL, $start + $wait_interval)]); + + do { + $seconds = (time() - $start); + + // logarithmic wait time calculation. + // Background: After jobs had been started, they often fork many workers. + // To not waste too much time, the sleep period increases. + $arg = (($seconds + 1) / ($wait_interval / 9)) + 1; + $sleep = min(1000000, round(log10($arg) * 1000000, 0)); + usleep($sleep); + + $pid = pcntl_waitpid(-1, $status, WNOHANG); + if ($pid > 0) { + Logger::info('Children quit via pcntl_waitpid', ['pid' => $pid, 'status' => $status]); + } + + $timeout = ($seconds >= $wait_interval); + } while (!$timeout && !Worker\IPC::JobsExists()); + + if ($timeout) { + $do_cron = true; + Logger::info('Woke up after $wait_interval seconds.', ['pid' => $pid, 'sleep' => $wait_interval]); + } else { + $do_cron = false; + Logger::info('Worker jobs are calling to be forked.', ['pid' => $pid]); + } + } + } + private function setupContainerForAddons(): void { /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ From a2c4585914c61569ab0d5ba1a82a71660c13d89f Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:13:04 +0000 Subject: [PATCH 07/26] simplify class names --- src/App.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.php b/src/App.php index 7a8acd39c1..19376d4a19 100644 --- a/src/App.php +++ b/src/App.php @@ -190,7 +190,7 @@ class App $this->registerErrorHandler(); // Check the database structure and possibly fixes it - \Friendica\Core\Update::check(\Friendica\DI::basePath(), true); + Update::check(DI::basePath(), true); $appMode = $this->container->create(Mode::class); @@ -224,7 +224,7 @@ class App $this->container = $this->container->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]); DI::init($this->container); - \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(\Psr\Log\LoggerInterface::class)); + \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(LoggerInterface::class)); if (DI::mode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); @@ -433,7 +433,7 @@ class App private function setupLegacyServerLocator(): void { - \Friendica\DI::init($this->container); + DI::init($this->container); } private function registerErrorHandler(): void From 8ed5dd3a30b5e46aa88e5e3f50a5061ef853de45 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:16:01 +0000 Subject: [PATCH 08/26] refactor setup container for addons and logger --- src/App.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/App.php b/src/App.php index 19376d4a19..7ff13e3e1b 100644 --- a/src/App.php +++ b/src/App.php @@ -218,10 +218,9 @@ class App public function processDaemon(array $options): void { - /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ - $addonLoader = $this->container->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); - $this->container = $this->container->addRules($addonLoader->getActiveAddonConfig('dependencies')); - $this->container = $this->container->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]); + $this->setupContainerForAddons(); + + $this->setupContainerForLogger(LogChannel::DAEMON); DI::init($this->container); \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(LoggerInterface::class)); From dc65958c1794cf7ba743d6161e7e2e5da07688d2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:17:22 +0000 Subject: [PATCH 09/26] refactor setup DI --- src/App.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.php b/src/App.php index 7ff13e3e1b..9202e80129 100644 --- a/src/App.php +++ b/src/App.php @@ -222,7 +222,8 @@ class App $this->setupContainerForLogger(LogChannel::DAEMON); - DI::init($this->container); + $this->setupLegacyServerLocator(); + \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(LoggerInterface::class)); if (DI::mode()->isInstall()) { From 68e729e1921a6df80eff5d6c62b08781ac9ea554 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:18:03 +0000 Subject: [PATCH 10/26] refactor using registerErrorHandler --- src/App.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.php b/src/App.php index 9202e80129..e5b95ec1d4 100644 --- a/src/App.php +++ b/src/App.php @@ -224,7 +224,7 @@ class App $this->setupLegacyServerLocator(); - \Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(LoggerInterface::class)); + $this->registerErrorHandler(); if (DI::mode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); From eb0e1c393f3c448cfee4d92dd9fa907688354b6c Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:26:10 +0000 Subject: [PATCH 11/26] Fix indent for HEREDOC --- src/App.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.php b/src/App.php index e5b95ec1d4..a1634e54f9 100644 --- a/src/App.php +++ b/src/App.php @@ -235,13 +235,13 @@ class App DI::config()->reload(); if (empty(DI::config()->get('system', 'pidfile'))) { - die(<< [ - 'pidfile' => '/path/to/daemon.pid', - ], - TXT + 'system' => [ + 'pidfile' => '/path/to/daemon.pid', + ], + TXT ); } From cb5a1daa408160c00994c39aaa8278c3fdfc4d9c Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:27:44 +0000 Subject: [PATCH 12/26] extract dependency for $_SERVER --- bin/daemon.php | 2 +- src/App.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index 5242d9bf4e..83774c7a2d 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -31,4 +31,4 @@ $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies. $app = \Friendica\App::fromDice($dice); -$app->processDaemon($options); +$app->processDaemon($_SERVER['argv'] ?? [], $options); diff --git a/src/App.php b/src/App.php index a1634e54f9..481b1c07c7 100644 --- a/src/App.php +++ b/src/App.php @@ -216,7 +216,7 @@ class App (new \Friendica\Core\Console($this->container, $argv))->execute(); } - public function processDaemon(array $options): void + public function processDaemon(array $argv, array $options): void { $this->setupContainerForAddons(); @@ -247,15 +247,15 @@ class App $pidfile = DI::config()->get('system', 'pidfile'); - if (in_array('start', $_SERVER['argv'])) { + if (in_array('start', $argv)) { $mode = 'start'; } - if (in_array('stop', $_SERVER['argv'])) { + if (in_array('stop', $argv)) { $mode = 'stop'; } - if (in_array('status', $_SERVER['argv'])) { + if (in_array('status', $argv)) { $mode = 'status'; } @@ -265,7 +265,7 @@ class App die("Please use either 'start', 'stop' or 'status'.\n"); } - if (empty($_SERVER['argv'][0])) { + if (empty($argv[0])) { die("Unexpected script behaviour. This message should never occur.\n"); } From 502d0d1b53626ca7675e577de2c1afa48ed981e7 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:30:09 +0000 Subject: [PATCH 13/26] Replace DI::mode() with container --- src/App.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App.php b/src/App.php index 481b1c07c7..165211f38b 100644 --- a/src/App.php +++ b/src/App.php @@ -226,11 +226,14 @@ class App $this->registerErrorHandler(); - if (DI::mode()->isInstall()) { + /** @var Mode */ + $mode = $this->container->create(Mode::class); + + if ($mode->isInstall()) { die("Friendica isn't properly installed yet.\n"); } - DI::mode()->setExecutor(Mode::DAEMON); + $mode->setExecutor(Mode::DAEMON); DI::config()->reload(); From 81d28bbb4c32d631ab298b05b0d331dab4beee66 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:34:32 +0000 Subject: [PATCH 14/26] Replace DI::config() with container --- src/App.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/App.php b/src/App.php index 165211f38b..95417b7ed5 100644 --- a/src/App.php +++ b/src/App.php @@ -235,9 +235,12 @@ class App $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 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)) { $mode = 'start'; @@ -358,7 +361,7 @@ class App // Just to be sure that this script really runs endlessly 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; $last_cron = 0; From f3703f433e3a7d9f2d028320e6e656c7280a6093 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:38:10 +0000 Subject: [PATCH 15/26] resolve double used variable name --- src/App.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.php b/src/App.php index 95417b7ed5..ad7b2c330d 100644 --- a/src/App.php +++ b/src/App.php @@ -254,20 +254,20 @@ class App $pidfile = $config->get('system', 'pidfile'); if (in_array('start', $argv)) { - $mode = 'start'; + $daemonMode = 'start'; } if (in_array('stop', $argv)) { - $mode = 'stop'; + $daemonMode = 'stop'; } if (in_array('status', $argv)) { - $mode = 'status'; + $daemonMode = 'status'; } $foreground = array_key_exists('f', $options) || array_key_exists('foreground', $options); - if (!isset($mode)) { + if (!isset($daemonMode)) { die("Please use either 'start', 'stop' or 'status'.\n"); } @@ -281,12 +281,12 @@ class App $pid = intval(file_get_contents($pidfile)); } - if (empty($pid) && in_array($mode, ['stop', 'status'])) { + if (empty($pid) && in_array($daemonMode, ['stop', 'status'])) { DI::keyValue()->set('worker_daemon_mode', false); die("Pidfile wasn't found. Is the daemon running?\n"); } - if ($mode == 'status') { + if ($daemonMode == 'status') { if (posix_kill($pid, 0)) { die("Daemon process $pid is running.\n"); } @@ -297,7 +297,7 @@ class App die("Daemon process $pid isn't running.\n"); } - if ($mode == 'stop') { + if ($daemonMode == 'stop') { posix_kill($pid, SIGTERM); unlink($pidfile); From bcbdcbd1ff24402eaafa20f08c733cd2a60192ae Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:42:41 +0000 Subject: [PATCH 16/26] Replace DI::keyValue() with container --- src/App.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/App.php b/src/App.php index ad7b2c330d..3c48d3cdb0 100644 --- a/src/App.php +++ b/src/App.php @@ -17,6 +17,7 @@ use Friendica\App\Router; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Content\Nav; use Friendica\Core\Config\Factory\Config; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Database\DBA; @@ -281,8 +282,11 @@ class App $pid = intval(file_get_contents($pidfile)); } + /** @var IManageKeyValuePairs */ + $keyValue = $this->container->create(IManageKeyValuePairs::class); + if (empty($pid) && in_array($daemonMode, ['stop', 'status'])) { - DI::keyValue()->set('worker_daemon_mode', false); + $keyValue->set('worker_daemon_mode', false); die("Pidfile wasn't found. Is the daemon running?\n"); } @@ -293,7 +297,7 @@ class App unlink($pidfile); - DI::keyValue()->set('worker_daemon_mode', false); + $keyValue->set('worker_daemon_mode', false); die("Daemon process $pid isn't running.\n"); } @@ -304,7 +308,7 @@ class App Logger::notice('Worker daemon process was killed', ['pid' => $pid]); - DI::keyValue()->set('worker_daemon_mode', false); + $keyValue->set('worker_daemon_mode', false); die("Worker daemon process $pid was killed.\n"); } @@ -356,7 +360,7 @@ class App DBA::connect(); } - DI::keyValue()->set('worker_daemon_mode', true); + $keyValue->set('worker_daemon_mode', true); // Just to be sure that this script really runs endlessly set_time_limit(0); From aba54ebbbe2be8d7bf6a807f9ebe6940d5ff3acc Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:46:54 +0000 Subject: [PATCH 17/26] Replace DI::basePath() with container --- src/App.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.php b/src/App.php index 3c48d3cdb0..821e7b7104 100644 --- a/src/App.php +++ b/src/App.php @@ -39,6 +39,7 @@ use Friendica\Network\HTTPException; use Friendica\Protocol\ATProtocol\DID; use Friendica\Security\ExAuth; use Friendica\Security\OpenWebAuth; +use Friendica\Util\BasePath; use Friendica\Util\DateTimeFormat; use Friendica\Util\HTTPInputData; use Friendica\Util\HTTPSignature; @@ -190,8 +191,11 @@ class App $this->registerErrorHandler(); + /** @var BasePath */ + $basePath = $this->container->create(BasePath::class); + // Check the database structure and possibly fixes it - Update::check(DI::basePath(), true); + Update::check($basePath->getPath(), true); $appMode = $this->container->create(Mode::class); @@ -370,10 +374,14 @@ class App $do_cron = true; $last_cron = 0; + /** @var BasePath */ + $basePath = $this->container->create(BasePath::class); + $path = $basePath->getPath(); + // Now running as a daemon. while (true) { // Check the database structure and possibly fixes it - Update::check(DI::basePath(), true); + Update::check($path, true); if (!$do_cron && ($last_cron + $wait_interval) < time()) { Logger::info('Forcing cron worker call.', ['pid' => $pid]); From 11540a8bffcbb9dcdb592a460ba4bcf9222b3d9f Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:49:34 +0000 Subject: [PATCH 18/26] Replace DI::system() with container --- src/App.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.php b/src/App.php index 821e7b7104..d4f3a35837 100644 --- a/src/App.php +++ b/src/App.php @@ -378,6 +378,9 @@ class App $basePath = $this->container->create(BasePath::class); $path = $basePath->getPath(); + /** @var System */ + $system = $this->container->create(System::class); + // Now running as a daemon. while (true) { // Check the database structure and possibly fixes it @@ -388,7 +391,7 @@ class App $do_cron = true; } - if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) { + if ($do_cron || (!$system->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) { Worker::spawnWorker($do_cron); } else { Logger::info('Cool down for 5 seconds', ['pid' => $pid]); From a09e18223876f440aeba820979683717d6082050 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 11:33:00 +0000 Subject: [PATCH 19/26] work with PSR-7 Request in App::runFrontend() --- src/App.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.php b/src/App.php index d4f3a35837..ac3762e044 100644 --- a/src/App.php +++ b/src/App.php @@ -177,7 +177,7 @@ class App $this->container->create(ModuleHTTPException::class), new HTTPInputData($request->getServerParams()), $start_time, - $request->getServerParams() + $request ); } @@ -549,8 +549,10 @@ class App ModuleHTTPException $httpException, HTTPInputData $httpInput, float $start_time, - array $server + ServerRequestInterface $request ) { + $server = $request->getServerParams(); + $requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? ''); $this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']); $request_start = microtime(true); From 082ed8745b5db09925288206c0b2f81bd558ad70 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 11:33:45 +0000 Subject: [PATCH 20/26] rename server vars --- src/App.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/App.php b/src/App.php index ac3762e044..5779360356 100644 --- a/src/App.php +++ b/src/App.php @@ -551,10 +551,10 @@ class App float $start_time, ServerRequestInterface $request ) { - $server = $request->getServerParams(); + $serverVars = $request->getServerParams(); - $requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? ''); - $this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']); + $requeststring = ($serverVars['REQUEST_METHOD'] ?? '') . ' ' . ($serverVars['REQUEST_URI'] ?? '') . ' ' . ($serverVars['SERVER_PROTOCOL'] ?? ''); + $this->logger->debug('Request received', ['address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '']); $request_start = microtime(true); $request = $_REQUEST; @@ -573,19 +573,19 @@ class App if (!$this->mode->isInstall()) { // Force SSL redirection if ($this->config->get('system', 'force_ssl') && - (empty($server['HTTPS']) || $server['HTTPS'] === 'off') && - (empty($server['HTTP_X_FORWARDED_PROTO']) || $server['HTTP_X_FORWARDED_PROTO'] === 'http') && - !empty($server['REQUEST_METHOD']) && - $server['REQUEST_METHOD'] === 'GET') { + (empty($serverVars['HTTPS']) || $serverVars['HTTPS'] === 'off') && + (empty($serverVars['HTTP_X_FORWARDED_PROTO']) || $serverVars['HTTP_X_FORWARDED_PROTO'] === 'http') && + !empty($serverVars['REQUEST_METHOD']) && + $serverVars['REQUEST_METHOD'] === 'GET') { System::externalRedirect($this->baseURL . '/' . $this->args->getQueryString()); } Core\Hook::callAll('init_1'); } - DID::routeRequest($this->args->getCommand(), $server); + DID::routeRequest($this->args->getCommand(), $serverVars); if ($this->mode->isNormal() && !$this->mode->isBackend()) { - $requester = HTTPSignature::getSigner('', $server); + $requester = HTTPSignature::getSigner('', $serverVars); if (!empty($requester)) { OpenWebAuth::addVisitorCookieForHandle($requester); } @@ -703,12 +703,12 @@ class App $response = $page->run($this->appHelper, $this->session, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId()); } - $this->logger->debug('Request processed sucessfully', ['response' => $response->getStatusCode(), 'address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]); - $this->logSlowCalls(microtime(true) - $request_start, $response->getStatusCode(), $requeststring, $server['HTTP_USER_AGENT'] ?? ''); + $this->logger->debug('Request processed sucessfully', ['response' => $response->getStatusCode(), 'address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]); + $this->logSlowCalls(microtime(true) - $request_start, $response->getStatusCode(), $requeststring, $serverVars['HTTP_USER_AGENT'] ?? ''); System::echoResponse($response); } catch (HTTPException $e) { - $this->logger->debug('Request processed with exception', ['response' => $e->getCode(), 'address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]); - $this->logSlowCalls(microtime(true) - $request_start, $e->getCode(), $requeststring, $server['HTTP_USER_AGENT'] ?? ''); + $this->logger->debug('Request processed with exception', ['response' => $e->getCode(), 'address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]); + $this->logSlowCalls(microtime(true) - $request_start, $e->getCode(), $requeststring, $serverVars['HTTP_USER_AGENT'] ?? ''); $httpException->rawContent($e); } $page->logRuntime($this->config, 'runFrontend'); From 17ff47f6d5c9ea6d0f9699d98a25bf9ee27b7835 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 11:35:32 +0000 Subject: [PATCH 21/26] remove dependency to global $_GET --- src/App.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/App.php b/src/App.php index 5779360356..1e3adae249 100644 --- a/src/App.php +++ b/src/App.php @@ -552,6 +552,7 @@ class App ServerRequestInterface $request ) { $serverVars = $request->getServerParams(); + $queryVars = $request->getQueryParams(); $requeststring = ($serverVars['REQUEST_METHOD'] ?? '') . ' ' . ($serverVars['REQUEST_URI'] ?? '') . ' ' . ($serverVars['SERVER_PROTOCOL'] ?? ''); $this->logger->debug('Request received', ['address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '']); @@ -592,23 +593,23 @@ class App } // ZRL - if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !$this->session->getLocalUserId()) { + if (!empty($queryVars['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !$this->session->getLocalUserId()) { // Only continue when the given profile link seems valid. // Valid profile links contain a path with "/profile/" and no query parameters - if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') && - strpos(parse_url($_GET['zrl'], PHP_URL_PATH) ?? '', '/profile/') !== false) { - $this->auth->setUnauthenticatedVisitor($_GET['zrl']); + if ((parse_url($queryVars['zrl'], PHP_URL_QUERY) == '') && + strpos(parse_url($queryVars['zrl'], PHP_URL_PATH) ?? '', '/profile/') !== false) { + $this->auth->setUnauthenticatedVisitor($queryVars['zrl']); OpenWebAuth::zrlInit(); } else { // Someone came with an invalid parameter, maybe as a DDoS attempt // We simply stop processing here - $this->logger->debug('Invalid ZRL parameter.', ['zrl' => $_GET['zrl']]); + $this->logger->debug('Invalid ZRL parameter.', ['zrl' => $queryVars['zrl']]); throw new HTTPException\ForbiddenException(); } } - if (!empty($_GET['owt']) && $this->mode->isNormal()) { - $token = $_GET['owt']; + if (!empty($queryVars['owt']) && $this->mode->isNormal()) { + $token = $queryVars['owt']; OpenWebAuth::init($token); } From 894cd5814fceece19d714d2e0930bb1b687ee541 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 11:41:27 +0000 Subject: [PATCH 22/26] remove HTTPInputData as argument --- src/App.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/App.php b/src/App.php index 1e3adae249..f3e081c29b 100644 --- a/src/App.php +++ b/src/App.php @@ -175,7 +175,6 @@ class App $this->container->create(Page::class), $this->container->create(Nav::class), $this->container->create(ModuleHTTPException::class), - new HTTPInputData($request->getServerParams()), $start_time, $request ); @@ -534,9 +533,7 @@ class App * @param IManagePersonalConfigValues $pconfig * @param Page $page The Friendica page printing container * @param ModuleHTTPException $httpException The possible HTTP Exception container - * @param HTTPInputData $httpInput A library for processing PHP input streams * @param float $start_time The start time of the overall script execution - * @param array $server The $_SERVER array * * @throws HTTPException\InternalServerErrorException * @throws \ImagickException @@ -547,10 +544,10 @@ class App Page $page, Nav $nav, ModuleHTTPException $httpException, - HTTPInputData $httpInput, float $start_time, ServerRequestInterface $request ) { + $httpInput = new HTTPInputData($request->getServerParams()); $serverVars = $request->getServerParams(); $queryVars = $request->getQueryParams(); From 619cb730ef3967bd96704b3b8663c4a4c09752a2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 12:18:03 +0000 Subject: [PATCH 23/26] Fix possible falsy return of getopt() --- .phpstan.neon | 3 ++- bin/daemon.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.phpstan.neon b/.phpstan.neon index 687b9d2f98..0aad06f8a6 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -7,8 +7,9 @@ parameters: paths: - addon/ - - src/ + - bin/daemon.php - index.php + - src/ excludePaths: analyse: diff --git a/bin/daemon.php b/bin/daemon.php index 83774c7a2d..06e8574cae 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -31,4 +31,4 @@ $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies. $app = \Friendica\App::fromDice($dice); -$app->processDaemon($_SERVER['argv'] ?? [], $options); +$app->processDaemon($_SERVER['argv'] ?? [], $options ?: []); From 5ca887d839a3aa022740046ecf6aa13c57b352ae Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 12:22:39 +0000 Subject: [PATCH 24/26] Check more bin files with PHPStan --- .phpstan.neon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.phpstan.neon b/.phpstan.neon index 0aad06f8a6..918ebe6eb8 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -7,6 +7,8 @@ parameters: paths: - addon/ + - bin/auth_ejabberd.php + - bin/console.php - bin/daemon.php - index.php - src/ From cdf3361f2ae9e90f55c043642a0500ff01db1da9 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 13:44:57 +0000 Subject: [PATCH 25/26] update messages.po --- view/lang/C/messages.po | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index fdec55075c..144b1c7b33 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2024.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-23 10:09+0000\n" +"POT-Creation-Date: 2024-12-26 13:40+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -646,10 +646,6 @@ msgstr "" msgid "Map" msgstr "" -#: src/App.php:255 -msgid "Apologies but the website is unavailable at the moment." -msgstr "" - #: src/App/Page.php:241 msgid "Delete this item?" msgstr "" From e685ff883707eabc7910ccf37d29cd3b79fc61a4 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 17:06:41 +0000 Subject: [PATCH 26/26] Fix method call for App::setupLegacyServiceLocator --- src/App.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.php b/src/App.php index 71211bc361..0345eb3adf 100644 --- a/src/App.php +++ b/src/App.php @@ -226,7 +226,7 @@ class App $this->setupContainerForLogger(LogChannel::DAEMON); - $this->setupLegacyServerLocator(); + $this->setupLegacyServiceLocator(); $this->registerErrorHandler();