mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
Testing on windows
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
db
|
||||
txt/
|
||||
*.db
|
||||
txt/
|
||||
txt2/
|
@@ -1,2 +0,0 @@
|
||||
db
|
||||
txt/
|
@@ -45,7 +45,7 @@ if (file_exists("d2im.db") && (file_exists($_SESSION['modname'].".db"))){
|
||||
// If there's data, process it and save
|
||||
if (!empty($_POST)) {
|
||||
|
||||
// save db name from post info conf file
|
||||
// save db name from post into conf file
|
||||
|
||||
require_once './src/D2SaveFile.php';
|
||||
$saver = new D2SaveFile();
|
||||
|
@@ -3,7 +3,7 @@ include "includes.php";
|
||||
|
||||
if (file_exists("d2im.db")) {
|
||||
|
||||
unlink(DB_FILE);
|
||||
if(file_exists(DB_FILE)) unlink(DB_FILE);
|
||||
|
||||
$files = new D2Files();
|
||||
$parser = new D2TxtParser();
|
||||
|
@@ -106,7 +106,7 @@ require_once "head.php";
|
||||
<hr style="margin: 60px;">
|
||||
<div class="offset-2 col-8">
|
||||
<h2>Select Mod folder</h2>
|
||||
<p style="font-family: lato">Example: D:\Diablo II\MODS\you-mod-name\</p>
|
||||
<p style="font-family: lato">Example: D:\Diablo II\MODS\your-mod-name\</p>
|
||||
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
|
||||
|
||||
<div style="margin-top: 20px;" class="ctrl-config">
|
||||
|
@@ -46,6 +46,7 @@ class D2Database {
|
||||
$tableName = basename($file);
|
||||
$tableName = strtolower(substr($tableName, 0, -4));
|
||||
|
||||
$sql = '';
|
||||
foreach ($data as $d) {
|
||||
$sql = "INSERT INTO `$tableName` (";
|
||||
if (!empty($d)) {
|
||||
|
@@ -55,12 +55,11 @@ class D2TxtParser {
|
||||
}
|
||||
, file($file));
|
||||
$header = array_shift($rows);
|
||||
$data = null;
|
||||
foreach ($rows as $row) {
|
||||
$data[] = @array_combine($header, $row);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user