22 lines
587 B
PHP
22 lines
587 B
PHP
|
|
<?php
|
||
|
|
// --- basic config ---
|
||
|
|
$db_file = __DIR__ . '/../mentalnet_funnies.db';
|
||
|
|
|
||
|
|
// password hash (generate with: php -r "echo password_hash('yourpassword', PASSWORD_DEFAULT);")
|
||
|
|
$ADMIN_PASS_HASH = 'pwhashgoeshere';
|
||
|
|
|
||
|
|
// create db if not exists
|
||
|
|
if (!file_exists($db_file)) {
|
||
|
|
$db = new SQLite3($db_file);
|
||
|
|
$db->exec("CREATE TABLE comics (
|
||
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||
|
|
title TEXT NOT NULL,
|
||
|
|
filename TEXT NOT NULL,
|
||
|
|
description TEXT,
|
||
|
|
date_added DATETIME DEFAULT CURRENT_TIMESTAMP
|
||
|
|
)");
|
||
|
|
} else {
|
||
|
|
$db = new SQLite3($db_file);
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
|