mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
[CI] Disable table verification for tests
The table was being checked before creation.
This commit is contained in:
parent
163bd48792
commit
abc453bac8
@ -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);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
class EnvSettings extends Settings {
|
||||
public function __construct($connect = true) {
|
||||
public function __construct($connect = true, $verify = false) {
|
||||
parent::__construct(false);
|
||||
$this->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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user