wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Imports;
|
||||
|
||||
use App\Filament\Imports\Helper\ImportBenchmark;
|
||||
use App\Filament\Imports\Helper\ImportDetails;
|
||||
use App\Filament\Imports\Helper\ImportEvents;
|
||||
use App\Filament\Imports\Helper\ImportFixtures;
|
||||
use App\Filament\Imports\Helper\ImportPlayer;
|
||||
use App\Models\StatistikoImport;
|
||||
|
||||
class StatistikoImporter
|
||||
{
|
||||
public static float $benchmarkStartTime;
|
||||
|
||||
public static int $benchmarkStartMemory;
|
||||
|
||||
public static int $startRowCount;
|
||||
|
||||
public static int $startQueries;
|
||||
|
||||
public static function run(object $record): void
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('max_execution_time', -1);
|
||||
|
||||
$table = $record->data_type;
|
||||
|
||||
$filePath = $record->file_name;
|
||||
|
||||
ImportBenchmark::start($table);
|
||||
|
||||
switch ($record['data_type']) {
|
||||
case 'details':
|
||||
ImportDetails::run($filePath);
|
||||
break;
|
||||
case 'events':
|
||||
ImportEvents::run($filePath);
|
||||
break;
|
||||
case 'fixtures':
|
||||
ImportFixtures::run($filePath);
|
||||
break;
|
||||
case 'player':
|
||||
ImportPlayer::run($filePath);
|
||||
break;
|
||||
}
|
||||
|
||||
StatistikoImport::query()->where('id', $record->id)->update(['has_run' => 1]);
|
||||
|
||||
ImportBenchmark::end($table);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user