diff --git a/inc/settings.php b/inc/settings.php index 3c0821a..a4294fa 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -171,7 +171,7 @@ class Settings { } } - protected function connect() { + protected function connect($verify=true) { $driver = $this->driver; $host = $this->host; $port = $this->port; @@ -197,9 +197,11 @@ class Settings { try { $this->conn = new PDO($dsn, $username, $password, $options); - $st = $this->conn->query("SELECT * FROM " . $this->table['config'] . " LIMIT 1;"); - $st->fetch(); - $st->closeCursor(); + if ($verify) { + $st = $this->conn->query("SELECT * FROM " . $this->table['config'] . " LIMIT 1;"); + $st->fetch(); + $st->closeCursor(); + } } catch (PDOException $e) { Settings::handle_error($this, $e); } diff --git a/inc/test/php/EnvSettings.php b/inc/test/php/EnvSettings.php index 1edb501..39165ab 100644 --- a/inc/test/php/EnvSettings.php +++ b/inc/test/php/EnvSettings.php @@ -1,7 +1,7 @@ host = getenv("MYSQL_HOST"); $this->database = getenv("MYSQL_DATABASE"); @@ -11,6 +11,6 @@ class EnvSettings extends Settings { $this->init_tables(); - if ($connect) $this->connect(); + if ($connect) $this->connect($verify); } }