Files
nuhodds_fi4/app/Console/Commands/Grapper/Sofascore.php
T
2026-07-03 07:40:17 +02:00

75 lines
2.0 KiB
PHP

<?php
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\Sofascore\CreateZip;
use App\Console\Commands\Grapper\Sofascore\DaysTournament;
use App\Console\Commands\Grapper\Sofascore\Grapper;
use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
use App\Console\Commands\Grapper\Sofascore\Helper\TaskConfig;
use App\Console\Commands\Grapper\Sofascore\PlayerPerSeason;
use App\Console\Commands\Grapper\Sofascore\SendMail;
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
use App\Console\Commands\Nuh;
use App\Utilities\Notice;
ini_set('magic_quotes_runtime', false);
class Sofascore
{
public static string $source_path;
public static string $storage_path;
public static function switch()
{
self::$source_path = app_path('/Console/Commands/Grapper/Sofascore/Grapped');
self::$storage_path = storage_path('zip_sofascore_data');
$task = Nuh::$options['task'] ?? 0;
$process = Nuh::$options['run'];
$days = LoadDays::load($task);
switch($process){
case 1:
PlayerPerSeason::run();
break;
case 2:
SettingsToLocal::run();
break;
case 3:
if($days){
CreateZip::run($days);
}
break;
case 4:
if($days){
SendMail::run($days);
}
break;
case 5:
if($days){
DaysTournament::run($days);
}
break;
case 6:
if($days){
Grapper::load($days);
}
break;
case 7:
if($days){
TaskConfig::set($task);
}
break;
default:
Notice::note('id not valid', 'br', 1);
}
}
}