DB Dump Working

This commit is contained in:
color.diff=auto
2021-03-24 04:26:51 -06:00
parent 50252def84
commit 7a6d2ace00
12 changed files with 17280 additions and 35 deletions

View File

@@ -26,10 +26,10 @@ class D2TxtParser {
public $path = TXT_PATH;
// Files specific to Unique Items
public $db;
public function __construct() {
$this->db = new D2Database();
}
public function parseFile($file) {
@@ -46,10 +46,10 @@ class D2TxtParser {
$allProps[] = $d['code'];
}
$filteredProps = array_diff($allProps, $propsToFilter);
return $filteredProps;
return $filteredProps;
}
public function parseData($file) {
public function parseData($file) {
$file = $this->path . $file;
$rows = array_map(function ($v) {
return str_getcsv($v, "\t");
@@ -58,9 +58,12 @@ class D2TxtParser {
$header = array_shift($rows);
foreach ($rows as $row) {
$data[] = @array_combine($header, $row);
}
}
$this->db->createTables($file, $data);
$this->db->fillsTables($file, $data);
return $data;
}
}
?>