Move 'bin/worker.php' to 'bin/console.php worker'

This commit is contained in:
Philipp 2025-01-02 14:37:56 +01:00
parent 07c4e606e1
commit c58cd835d2
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
4 changed files with 108 additions and 55 deletions

View file

@ -7,6 +7,8 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Starts the background processing
*
* @deprecated 2025.01 use bin/console.php worker instead
*/
if (php_sapi_name() !== 'cli') {
@ -16,9 +18,6 @@ if (php_sapi_name() !== 'cli') {
use Dice\Dice;
// Get options
$options = getopt('sn', ['spawn', 'no_cron']);
// Ensure that worker.php is executed from the base path of the installation
chdir(dirname(__DIR__));
@ -28,4 +27,7 @@ $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.
$app = \Friendica\App::fromDice($dice);
$app->processWorker($options ?: []);
$argv = $_SERVER['argv'] ?? [];
array_splice($argv, 1, 0, "worker");
$app->processConsole($argv);