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); } // Process Files Manually In Sqlite processFilesManuallyInSqlite(); // function toPngAll() { // $q = realpath("bin\qdc6.exe"); // $iPath = $_SESSION['modpath'] . "\data\global\items"; // $oPath = realpath("docs\\{$_SESSION['modname']}\img\\items"); // exec("$q --first-frame-only \"$iPath\" -o \"$oPath\""); // } // if (!is_dir("docs\\{$_SESSION['modname']}")) { // mkdir("docs\\{$_SESSION['modname']}"); // mkdir("docs\\{$_SESSION['modname']}\\fonts", 0777, TRUE); // mkdir("docs\\{$_SESSION['modname']}\\img\items", 0777, TRUE); // mkdir("docs\\{$_SESSION['modname']}\\res", 0777, TRUE); // } // rcopy(realpath('docs/template/fonts'), realpath("docs\\{$_SESSION['modname']}\\fonts")); // rcopy(realpath('docs/template/img'), realpath("docs\\{$_SESSION['modname']}\\img")); // rcopy(realpath('docs/template/res'), realpath("docs\\{$_SESSION['modname']}\\res")); // toPngAll(); /* Process tbl files */ $tbl = $_SESSION['tbl']; $strs = ["dummy" => "dummy"]; foreach (glob($tbl . "*.tbl") as $filename) { $strings = D2Tbl::getStrings($filename); if (!empty($strings)) $strs = array_merge($strs, $strings); } $db->writeTbl($strs); // write each table to invidual db table $tbl = $_SESSION['tbl']; foreach (glob($tbl . "*.tbl") as $filename) { $tblName = pathinfo($filename)['filename']; $strings = D2Tbl::getStrings($filename); if (!empty($strings)) { $db->writeTbls($tblName, $strings); } } echo "Mod files reloaded!"; require_once './src/D2Strings.php'; new D2Strings(); } else { // if config db does not exist, go to configure page header("Location: /src/D2Config.php"); }