Using getopt for CLI arguments (#5446)

* Adding Argument class to Friendica

* Adding Argument class to Friendica

* Adding Argument class to Friendica

* fixing arguments for `spawnWorker`

* Adding `use Friendica\BaseObject` to `ApiTest.php`

* Refactoring the argument-usages of Friendica

* Refactoring the argument-usages of Friendica

* removing superfluous []
This commit is contained in:
Philipp 2018-07-23 13:40:52 +02:00 committed by Hypolite Petovan
parent ea24ac9d95
commit cd52d0b3e9
5 changed files with 38 additions and 15 deletions

View file

@ -1010,13 +1010,11 @@ class Worker
*/
public static function spawnWorker($do_cron = false)
{
$args = ["bin/worker.php"];
$command = 'bin/worker.php';
if (!$do_cron) {
$args[] = "no_cron";
}
$args = [ 'cron' => $do_cron ];
get_app()->proc_run($args);
get_app()->proc_run($command, $args);
// after spawning we have to remove the flag.
if (Config::get('system', 'worker_daemon_mode', false)) {