new sofaskore task add date to select in statistics
This commit is contained in:
1 parent
f8e6f8183b
commit
5f4a788927
18 files changed
+207
-281
No files matched your search
+13
-12
@@ -2,27 +2,27 @@
|
||||
|
||||
namespace App\Utilities;
|
||||
|
||||
use App\Console\Commands\Grapper\Sofascore;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use ZipArchive;
|
||||
|
||||
class ZipFolder
|
||||
{
|
||||
public static function create(string $day){
|
||||
|
||||
$zipFilePath = storage_path('zip_sofascore_data').'/'.$day.'.zip';
|
||||
public static function create(string $day)
|
||||
{
|
||||
|
||||
$path = Sofascore::$grapper_path.$day;
|
||||
$zipFilePath = storage_path('sofascore_data') . '/' . $day . '.zip';
|
||||
|
||||
$path = storage_path('sofascore_data') . $day;
|
||||
|
||||
$zip = new ZipArchive();
|
||||
|
||||
if ($zip->open($zipFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === true) {
|
||||
|
||||
if(is_dir($path)){
|
||||
if (is_dir($path)) {
|
||||
|
||||
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
||||
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
@@ -37,13 +37,14 @@ class ZipFolder
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_tree(string $dir, &$results = array()){
|
||||
public static function get_tree(string $dir, &$results = array())
|
||||
{
|
||||
$files = scandir($dir);
|
||||
foreach($files as $value){
|
||||
$path = realpath($dir.DIRECTORY_SEPARATOR.$value);
|
||||
if(!is_dir($path)) {
|
||||
foreach ($files as $value) {
|
||||
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
|
||||
if (!is_dir($path)) {
|
||||
$results[] = $path;
|
||||
} else if($value != "." && $value != "..") {
|
||||
} else if ($value != "." && $value != "..") {
|
||||
self::get_tree($path, $results);
|
||||
$results[] = $path;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user