more sqlite niceness
This commit is contained in:
parent
f3a3d50f95
commit
4e4f0be4e5
3 changed files with 8 additions and 2 deletions
|
@ -2,6 +2,10 @@
|
||||||
DirectoryIndex index.php5 index.php
|
DirectoryIndex index.php5 index.php
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
<FilesMatch "\.(sqlite|sdb|s3db|db)$">
|
||||||
|
Deny from all
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ class SQLite extends DBEngine {
|
||||||
$extras = "";
|
$extras = "";
|
||||||
foreach(explode(",", $data) as $bit) {
|
foreach(explode(",", $data) as $bit) {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if(preg_match("/INDEX\s+\((.*)\)/", $bit, $matches)) {
|
if(preg_match("/INDEX\s*\((.*)\)/", $bit, $matches)) {
|
||||||
$col = $matches[1];
|
$col = $matches[1];
|
||||||
$extras .= "CREATE INDEX {$name}_{$col} on $name($col);";
|
$extras .= "CREATE INDEX {$name}_{$col} on $name($col);";
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,9 @@ try {
|
||||||
|
|
||||||
|
|
||||||
// for databases which support transactions
|
// for databases which support transactions
|
||||||
$database->db->CommitTrans(true);
|
if($database->engine->name != "sqlite") {
|
||||||
|
$database->db->CommitTrans(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception $e) {
|
catch(Exception $e) {
|
||||||
$version = VERSION;
|
$version = VERSION;
|
||||||
|
|
Reference in a new issue