mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
Cube documenter working half way
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* This software must not be used for commercial purposes
|
||||
* This software must not be used for commercial purposes
|
||||
* without my consent. Any sales or commercial use are prohibited
|
||||
* without my express knowledge and consent.
|
||||
|
||||
@@ -57,6 +57,15 @@ function processCubeMain() {
|
||||
exec("$bin $dbfile \".separator \\\"\\t\\\"\" \".import \\\"$cubemain\\\" cubemain\"");
|
||||
}
|
||||
|
||||
function processCubeMainLinux() {
|
||||
|
||||
$bin = "/usr/bin/sqlite3";
|
||||
$dbfile = getcwd() . DIRECTORY_SEPARATOR . DB_FILE;
|
||||
$cubemain = TXT_PATH . "CubeMain.txt";
|
||||
|
||||
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(APP_DB)) {
|
||||
if (file_exists($_SESSION['modname'] . ".db")) {
|
||||
@@ -83,8 +92,8 @@ if (file_exists(APP_DB)) {
|
||||
foreach ($files->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);
|
||||
@@ -92,6 +101,7 @@ if (file_exists(APP_DB)) {
|
||||
}
|
||||
|
||||
processCubeMain('cubemain.txt');
|
||||
processCubeMainLinux('cubemain.txt');
|
||||
// put in html redirect as backup, because
|
||||
// for some odd reason windows gives
|
||||
// an error on header() but linux does not.
|
||||
@@ -99,21 +109,21 @@ if (file_exists(APP_DB)) {
|
||||
|
||||
/*
|
||||
Process tbl files
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
$tbl = $_SESSION['tbl'];
|
||||
|
||||
|
||||
$string = D2Tbl::getStrings($tbl."string.tbl");
|
||||
$stringExpansion = D2Tbl::getStrings($tbl."expansionstring.tbl");
|
||||
$stringPatch = D2Tbl::getStrings($tbl."patchstring.tbl");
|
||||
|
||||
|
||||
$strings = array_merge($stringPatch, $stringExpansion, $string);
|
||||
|
||||
|
||||
$db->writeTbl($strings);
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// if config db does not exist, go to configure page
|
||||
header("Location: /src/D2Config.php");
|
||||
|
Reference in New Issue
Block a user