wip
This commit is contained in:
1 parent
1890b1fcc2
commit
bf48caa395
22 files changed
+510
-123
No files matched your search
@@ -4,14 +4,16 @@ namespace App\Console\Commands\Grapper;
|
||||
|
||||
use App\Console\Commands\Grapper\Sofascore\Grapper;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\ZipFolder;
|
||||
use App\Console\Commands\Grapper\Sofascore\PlayerPerSeason;
|
||||
use App\Console\Commands\Grapper\Sofascore\Rose;
|
||||
use App\Console\Commands\Grapper\Sofascore\SendMail;
|
||||
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
|
||||
use App\Console\Commands\Grapper\Sofascore\SqlMover;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\SofaScoreTask;
|
||||
use App\Utilities\Notice;
|
||||
use App\Utilities\ZipFolder;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
ini_set('magic_quotes_runtime', false);
|
||||
|
||||
@@ -19,6 +21,10 @@ class Sofascore
|
||||
{
|
||||
public static string $storage;
|
||||
|
||||
public static string $archive_name;
|
||||
|
||||
public static string $useragent;
|
||||
|
||||
public static function switch()
|
||||
{
|
||||
$function = Nuh::$options['fun'];
|
||||
@@ -35,23 +41,32 @@ class Sofascore
|
||||
|
||||
case 3:
|
||||
self::setStorage();
|
||||
|
||||
Grapper::load();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
self::setStorage();
|
||||
ZipFolder::create(self::$storage);
|
||||
|
||||
ZipFolder::create();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
self::setStorage();
|
||||
|
||||
SendMail::run();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
self::setStorage();
|
||||
|
||||
Rose::run();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
SqlMover::run();
|
||||
break;
|
||||
|
||||
default:
|
||||
Notice::note('id not valid', 'br', 1);
|
||||
}
|
||||
@@ -61,6 +76,29 @@ class Sofascore
|
||||
{
|
||||
$task = Nuh::$options['task'];
|
||||
|
||||
self::$storage = storage_path('sofascore_data') . '/' . Strings::clean(SofaScoreTask::where('id', $task)->value('name'));
|
||||
self::$storage = storage_path('sofascore_data') . '/';
|
||||
self::$useragent = 4;
|
||||
|
||||
$storage_name = Strings::clean(SofaScoreTask::where('id', $task)->value('name')) . '/';
|
||||
|
||||
switch ($task) {
|
||||
case 1:
|
||||
self::$archive_name = Carbon::now()->subDays(3)->format('Y-m-d') . '.zip';
|
||||
self::$storage .= $storage_name;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
self::$archive_name = $storage_name . '.zip';
|
||||
self::$storage .= $storage_name;
|
||||
break;
|
||||
case 4:
|
||||
self::$archive_name = 'rosa-' . Carbon::now()->format('Y-m-d') . '.zip';
|
||||
self::$storage .= $storage_name . 'rosa-' . Carbon::now()->format('Y-m-d');
|
||||
break;
|
||||
|
||||
default:
|
||||
self::$archive_name = 'archive.zip';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user