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

70 lines
1.7 KiB
PHP

<?php
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\Sofascore\DaysTournament;
use App\Console\Commands\Grapper\Sofascore\Grapper;
use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
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\Models\SofaScoreTask;
use App\Utilities\Notice;
use App\Utilities\ZipFolder;
ini_set('magic_quotes_runtime', false);
class Sofascore
{
public static string $storage;
public static function switch()
{
$function = Nuh::$options['fun'];
switch ($function) {
case 1:
PlayerPerSeason::run();
break;
case 2:
SettingsToLocal::run();
break;
case 3:
DaysTournament::run();
break;
case 4:
self::setStorage();
Grapper::load();
break;
case 5:
self::setStorage();
ZipFolder::create(self::$storage);
break;
case 6:
self::setStorage();
SendMail::run();
break;
default:
Notice::note('id not valid', 'br', 1);
}
}
public static function setStorage()
{
$task = Nuh::$options['task'];
self::$storage = storage_path('sofascore_data') . '/' . Strings::clean(SofaScoreTask::where('id', $task)->value('name'));
dd(self::$storage);
}
}