From 610267a3ea6cd909a1c0dbfec11f688dc4f9a66c Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 8 Jan 2025 22:20:06 +0000 Subject: [PATCH] Move Console call into App class --- bin/console.php | 5 ++++- bin/daemon.php | 5 ++++- bin/jetstream.php | 5 ++++- bin/worker.php | 5 ++++- src/App.php | 5 +++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/bin/console.php b/bin/console.php index 63412887d5..404f327868 100755 --- a/bin/console.php +++ b/bin/console.php @@ -20,4 +20,7 @@ require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php')); $container = \Friendica\Core\Container::fromDice($dice); -\Friendica\Core\Console::create($container, $_SERVER['argv'] ?? [])->execute(); + +$app = \Friendica\App::fromContainer($container); + +$app->processConsole($_SERVER['argv'] ?? []); diff --git a/bin/daemon.php b/bin/daemon.php index 18af315bc3..a1c0abbfaf 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -32,4 +32,7 @@ $argv = $_SERVER['argv'] ?? []; array_splice($argv, 1, 0, "daemon"); $container = \Friendica\Core\Container::fromDice($dice); -\Friendica\Core\Console::create($container, $argv)->execute(); + +$app = \Friendica\App::fromContainer($container); + +$app->processConsole($argv); diff --git a/bin/jetstream.php b/bin/jetstream.php index e3df667d3f..ac33e8ff2a 100755 --- a/bin/jetstream.php +++ b/bin/jetstream.php @@ -27,4 +27,7 @@ $argv = $_SERVER['argv'] ?? []; array_splice($argv, 1, 0, "jetstream"); $container = \Friendica\Core\Container::fromDice($dice); -\Friendica\Core\Console::create($container, $argv)->execute(); + +$app = \Friendica\App::fromContainer($container); + +$app->processConsole($argv); diff --git a/bin/worker.php b/bin/worker.php index a58d657a0f..fa238b66a2 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -29,4 +29,7 @@ $argv = $_SERVER['argv'] ?? []; array_splice($argv, 1, 0, "worker"); $container = \Friendica\Core\Container::fromDice($dice); -\Friendica\Core\Console::create($container, $argv)->execute(); + +$app = \Friendica\App::fromContainer($container); + +$app->processConsole($argv); diff --git a/src/App.php b/src/App.php index 487707f9fd..10c3603199 100644 --- a/src/App.php +++ b/src/App.php @@ -168,6 +168,11 @@ class App ); } + public function processConsole(array $argv): void + { + (\Friendica\Core\Console::create($this->container, $argv))->execute(); + } + public function processEjabberd(): void { $this->container->setup(LogChannel::AUTH_JABBERED, false);