Store thread data in sqlite db instead of file.
This commit is contained in:
parent
ee6e0f8b24
commit
17ad7a29cf
File diff suppressed because it is too large
Load Diff
|
@ -1499,6 +1499,23 @@ function mail_db_open($database, $table = 'messages')
|
|||
return ($dbh);
|
||||
}
|
||||
|
||||
function threads_db_open($database, $table="threads")
|
||||
{
|
||||
try {
|
||||
$dbh = new PDO('sqlite:' . $database);
|
||||
} catch (PDOException $e) {
|
||||
echo 'Connection failed: ' . $e->getMessage();
|
||||
exit();
|
||||
}
|
||||
$dbh->exec("CREATE TABLE IF NOT EXISTS $table(
|
||||
id INTEGER PRIMARY KEY,
|
||||
headers TEXT,
|
||||
unique (headers))");
|
||||
$stmt = $dbh->query('CREATE INDEX IF NOT EXISTS id_headers on ' . $table . '(headers)');
|
||||
$stmt->execute();
|
||||
return ($dbh);
|
||||
}
|
||||
|
||||
function history_db_open($database, $table = 'history')
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue