Skip to content

Commit

Permalink
createdb filename add
Browse files Browse the repository at this point in the history
  • Loading branch information
crucifyer committed Aug 14, 2024
1 parent 75270f6 commit 826e979
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# use fireholdb.sqlite with fireholdb.class.php
*/

if(!isset($_SERVER['argv'][1]) || !is_dir($_SERVER['argv'][1])) die("php createdb.php fireholdir\n");
if(!isset($_SERVER['argv'][1]) || !is_dir($_SERVER['argv'][1])) die("php createdb.php fireholdir [dbfile]\n");
$update = true;
$binaryip = true;

$updatestamp = file_exists('updatestamp') ? file_get_contents('updatestamp') : 0;
$lastmtime = 0;
$db = new PDO('sqlite:'.__DIR__.'/fireholdb.sqlite');
$db = new PDO('sqlite:'.($_SERVER['argv'][2] ?? __DIR__.'/fireholdb.sqlite'));
if(!$db->query("SELECT name FROM sqlite_master WHERE type = 'table' AND name='fireholdb'")->fetch()) {
$queries = preg_split('~;\s*~i', file_get_contents(__DIR__.'/schema.sql'), -1, PREG_SPLIT_NO_EMPTY);
foreach($queries as $query) {
Expand Down

0 comments on commit 826e979

Please sign in to comment.