From c45f35076bb0a70e46282621493635e958187765 Mon Sep 17 00:00:00 2001 From: "color.diff=auto" Date: Sat, 27 Mar 2021 03:40:43 -0600 Subject: [PATCH] ZyEl cubemain too big, parse using .import --- src/D2Files.php | 3 ++- src/D2TxtParser.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/D2Files.php b/src/D2Files.php index 1b444c4..2e9dffd 100644 --- a/src/D2Files.php +++ b/src/D2Files.php @@ -25,7 +25,8 @@ class D2Files { public function __construct() { $filesToIgnore = [ - "AiParms.txt" + "AiParms.txt", + "CubeMain.txt" ]; $glob = glob($_SESSION['path'].'*.txt'); foreach ($glob as $g){ diff --git a/src/D2TxtParser.php b/src/D2TxtParser.php index 6fe96c7..9bcc4ab 100644 --- a/src/D2TxtParser.php +++ b/src/D2TxtParser.php @@ -32,6 +32,9 @@ class D2TxtParser { } public function parseFile($file) { + if ($file == "CubeMain.txt") { + $this->processCubeMain($file); + } return $this->parseData($file); } @@ -58,5 +61,9 @@ class D2TxtParser { } return $data; } + + public function processCubeMain($file){ + exec("sqlite3 ".DB_FILE." '.separator \"t\"' '.import ".TXT_PATH."$file cubemain'"); + } } ?> \ No newline at end of file