From 4e4f0be4e540e35e40a1ee681370845c0f9c8fab Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 22 Jan 2009 07:51:50 -0800 Subject: [PATCH] more sqlite niceness --- .htaccess | 4 ++++ core/database.class.php | 2 +- index.php | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index 2a48b3a2..ab03a418 100644 --- a/.htaccess +++ b/.htaccess @@ -2,6 +2,10 @@ DirectoryIndex index.php5 index.php + +Deny from all + + RewriteEngine on diff --git a/core/database.class.php b/core/database.class.php index a87c4df3..c8c03188 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -113,7 +113,7 @@ class SQLite extends DBEngine { $extras = ""; foreach(explode(",", $data) as $bit) { $matches = array(); - if(preg_match("/INDEX\s+\((.*)\)/", $bit, $matches)) { + if(preg_match("/INDEX\s*\((.*)\)/", $bit, $matches)) { $col = $matches[1]; $extras .= "CREATE INDEX {$name}_{$col} on $name($col);"; } diff --git a/index.php b/index.php index bb1fef13..db83fcbf 100644 --- a/index.php +++ b/index.php @@ -66,7 +66,9 @@ try { // for databases which support transactions - $database->db->CommitTrans(true); + if($database->engine->name != "sqlite") { + $database->db->CommitTrans(true); + } } catch(Exception $e) { $version = VERSION;