Files
nuhodds_fi4/app/Console/Commands/Grapper/Grapper.php
T
2025-08-24 20:33:57 +02:00

78 lines
2.0 KiB
PHP

<?php
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\TxOdds\TxOdds;
use App\Models\Supervisor;
use App\Utilities\Notice;
use App\Utilities\Supervisorctl;
use Illuminate\Console\Command;
class Grapper extends Command
{
public static $event = [];
public static $_send = [];
public static $sport_id = 0;
public static $options = [];
public static $force = 0;
public static $debug = 0;
public static $domain = '';
public static $auth = '';
protected $signature = 'gra {process=help} {eventid=0} {--d} {--f} {--a} {--p} {--w}';
protected $description = 'Grapper';
public function handle()
{
self::$options = $this->options();
dd(self::$options);
self::$options['supervisor_id'] = $this->argument('process');
self::$options['event_id'] = $this->argument('eventid');
if ($this->argument('process') == 'help') {
$txt = PHP_EOL.'a gra process [id] eventid [id]'.PHP_EOL;
$txt .= '--d debug'.PHP_EOL;
$txt .= '--f force update market'.PHP_EOL;
$txt .= '--a reload all'.PHP_EOL;
$txt .= '--w reload one week'.PHP_EOL;
$txt .= '--p print odds'.PHP_EOL.PHP_EOL;
$txt .= 'eventid'.PHP_EOL.PHP_EOL;
$txt .= 'use "gra l" to show options'.PHP_EOL;
Notice::note($txt, 'b', 1);
} elseif ($this->argument('process') == 'l') {
$txt = 'list of grapper processes';
$txt .= Supervisor::list('gra');
Notice::note($txt, 'b', 1);
}
Supervisorctl::start(self::$options);
Helper::get_auth_string();
switch (self::$options['provider_id']) {
case 1:
case 2:
TxOdds::switch();
break;
case 3:
// betsapi
break;
default:
Note::notice('Provider not defined', 'r', 1);
break;
}
Supervisorctl::end(self::$options);
}
}