]> git.joonet.de Git - adminer.git/commitdiff
Avoid fatal error
authorJakub Vrana <jakub@vrana.cz>
Thu, 2 Dec 2010 08:56:10 +0000 (09:56 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 2 Dec 2010 08:56:10 +0000 (09:56 +0100)
adminer/drivers/sqlite.inc.php

index 87498ae15db9d8dfb0e2d9adc48796057cdfb359..d075988228c36e8b0e21a8247dbd2ca2ac375dc5 100644 (file)
@@ -173,26 +173,28 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                
        }
 
-       class Min_DB extends Min_SQLite {
-               
-               function Min_DB() {
-                       $this->Min_SQLite(":memory:");
-               }
-               
-               function select_db($filename) {
-                       if (is_readable($filename) && $this->query("ATTACH " . $this->quote(ereg("(^[/\\]|:)", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
-                               $this->Min_SQLite($filename);
-                               return true;
+       if (class_exists("Min_SQLite")) {
+               class Min_DB extends Min_SQLite {
+                       
+                       function Min_DB() {
+                               $this->Min_SQLite(":memory:");
+                       }
+                       
+                       function select_db($filename) {
+                               if (is_readable($filename) && $this->query("ATTACH " . $this->quote(ereg("(^[/\\]|:)", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
+                                       $this->Min_SQLite($filename);
+                                       return true;
+                               }
+                               return false;
+                       }
+                       
+                       function multi_query($query) {
+                               return $this->_result = $this->query($query);
+                       }
+                       
+                       function next_result() {
+                               return false;
                        }
-                       return false;
-               }
-               
-               function multi_query($query) {
-                       return $this->_result = $this->query($query);
-               }
-               
-               function next_result() {
-                       return false;
                }
        }