Move daemon to Console Command

This commit is contained in:
Philipp 2024-12-30 12:40:42 +01:00
parent afa2969b39
commit b0ec3ad0c9
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
4 changed files with 262 additions and 222 deletions

View file

@ -19,9 +19,6 @@ if (php_sapi_name() !== 'cli') {
use Dice\Dice;
// Get options
$options = getopt('f', ['foreground']);
// Ensure that daemon.php is executed from the base path of the installation
chdir(dirname(__DIR__));
@ -31,4 +28,7 @@ $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.
$app = \Friendica\App::fromDice($dice);
$app->processDaemon($_SERVER['argv'] ?? [], $options ?: []);
$argv = $_SERVER['argv'] ?? [];
array_splice($argv, 1, 0, "daemon");
$app->processConsole($argv);