Move Console call into App class

This commit is contained in:
Art4 2025-01-08 22:20:06 +00:00
parent 744bf9f971
commit 610267a3ea
5 changed files with 21 additions and 4 deletions

View file

@ -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'] ?? []);

View file

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

View file

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

View file

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

View file

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