more sqlite niceness

autocomplete
Shish 14 years ago
parent f3a3d50f95
commit 4e4f0be4e5
  1. 4
      .htaccess
  2. 2
      core/database.class.php
  3. 4
      index.php

@ -2,6 +2,10 @@
DirectoryIndex index.php5 index.php
</IfModule>
<FilesMatch "\.(sqlite|sdb|s3db|db)$">
Deny from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine on

@ -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);";
}

@ -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;

Loading…
Cancel
Save