mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-19 01:52:09 +00:00
sqlite3.exe import cubemain working
This commit is contained in:
@@ -5,7 +5,16 @@
|
||||
session_start();
|
||||
|
||||
include "./_pdo.php";
|
||||
function processCubeMain(){
|
||||
|
||||
$bin = getcwd().DIRECTORY_SEPARATOR."bin".DIRECTORY_SEPARATOR."sqlite3.exe ";
|
||||
$dbfile = getcwd().DIRECTORY_SEPARATOR.DB_FILE;
|
||||
$cubemain = TXT_PATH."cubemain.txt";
|
||||
|
||||
// D:\Documents\D2IM\www\bin\sqlite3.exe D:\Documents\D2IM\www\ZyEl4.5.db ".separator \"\t"\" ".import \"D:\\Diablo II\\MODS\\D2SE_Zy-El mod v4.5 HiRes\\data\\global\\excel\\cubemain.txt\" cubemain"
|
||||
|
||||
exec("$bin $dbfile \".separator \\\"\\t\\\"\" \".import \\\"$cubemain\\\" cubemain\"");
|
||||
}
|
||||
// check to see if config db exists or if for some reason it doesn't exist
|
||||
if (file_exists("d2im.db")) {
|
||||
if (file_exists($_SESSION['modname'] . ".db")) {
|
||||
@@ -27,6 +36,8 @@ 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);
|
||||
@@ -37,6 +48,8 @@ if (file_exists("d2im.db")) {
|
||||
$db->fillsTables($k, $v);
|
||||
}
|
||||
|
||||
unset($data);
|
||||
processCubeMain('cubemain.txt');
|
||||
// put in html redirect as backup, because
|
||||
// for some odd reason windows gives
|
||||
// an error on header() but linux does not.
|
||||
|
Reference in New Issue
Block a user