mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 12:36:03 +00:00
55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
require_once "./src/D2Functions.php";
|
|
require_once "./src/D2Database.php";
|
|
require_once './src/D2Files.php';
|
|
require_once './src/D2TxtParser.php';
|
|
|
|
define('DB_FILE', 'db');
|
|
|
|
include "./_pdo.php";
|
|
|
|
$filename = 'd2im.conf';
|
|
|
|
if (file_exists($filename)) {
|
|
|
|
$p = file_get_contents($filename);
|
|
if (is_dir($p)) {
|
|
$path = $p;
|
|
define('TXT_PATH', $p);
|
|
}
|
|
}
|
|
|
|
|
|
// parse txt data
|
|
$files = new D2Files();
|
|
$parser = new D2TxtParser();
|
|
$db = new D2Database();
|
|
|
|
$data['Armor'] = $parser->parseFile($files->getFile('Armor'));
|
|
$data['Gems'] = $parser->parseFile($files->getFile('Gems'));
|
|
$data['ItemTypes'] = $parser->parseFile($files->getFile('ItemTypes'));
|
|
$data['Misc'] = $parser->parseFile($files->getFile('Misc'));
|
|
$prop = $parser->parseFile($files->getFile('Properties'));
|
|
$data['SetItems'] = $parser->parseFile($files->getFile('SetItems'));
|
|
$data['Sets'] = $parser->parseFile($files->getFile('Sets'));
|
|
$data['UniqueItems'] = $parser->parseFile($files->getFile('UniqueItems'));
|
|
$data['Weapons'] = $parser->parseFile($files->getFile('Weapons'));
|
|
|
|
foreach ($data as $k => $v) {
|
|
|
|
$db->createTables($files->getFile($k), $v);
|
|
$db->fillsTables($files->getFile($k), $v);
|
|
}
|
|
sleep(2);
|
|
?>
|
|
|
|
<div class="container container-top">
|
|
<h1><img src="/img/Diablo2.png" style="float:left">Files Processed</h1>
|
|
<a class="btn btn-outline-danger" style="color:red; font-size: 18px;float:right;" href="/">X</a>
|
|
<hr style="margin: 60px;">
|
|
|
|
<h1>Loading app...</h1>
|
|
</div>
|
|
<?php
|
|
sleep(2);
|
|
header('Location: /');
|