diff --git a/processFiles.php b/processFiles.php index 3d81bb5..5178437 100644 --- a/processFiles.php +++ b/processFiles.php @@ -3,7 +3,6 @@ // have been created. Config writes active mod to session. session_start(); - include "./_pdo.php"; function processCubeMain(){ @@ -36,19 +35,18 @@ if (file_exists("d2im.db")) { $parser = new D2TxtParser(); $db = new D2Database(); - $data = null; - + // Parse all files foreach ($files->files as $k => $v) { $data[$v] = $parser->parseFile($v); } + // Write all parse data to mod db foreach ($data as $k => $v) { $db->createTables($k, $v); $db->fillsTables($k, $v); } - unset($data); processCubeMain('cubemain.txt'); // put in html redirect as backup, because // for some odd reason windows gives diff --git a/src/D2Config.php b/src/D2Config.php index 4596636..a2a0960 100644 --- a/src/D2Config.php +++ b/src/D2Config.php @@ -74,7 +74,7 @@ ERROR: INVALID PATH'; $path = $_POST['path']; $path = rtrim($_POST['path'], "/"); $path = $path . DIRECTORY_SEPARATOR; - + if (!is_dir($path)) { echo '

ERROR: INVALID PATH

'; diff --git a/src/D2Files.php b/src/D2Files.php index 518942e..2df817c 100644 --- a/src/D2Files.php +++ b/src/D2Files.php @@ -29,9 +29,9 @@ class D2Files { ]; $glob = glob($_SESSION['path'].'*.txt'); foreach ($glob as $g){ - $files[] = strtolower(basename($g)); + $files[] = basename($g); } - $this->files = array_diff($files, $filesToIgnore); + $this->files = array_udiff($files, $filesToIgnore, 'strcasecmp'); return $this->files; } }