small cleanup
This commit is contained in:
@ -91,14 +91,19 @@ class Database {
|
||||
$this->errorMessage = $Exception->getMessage();
|
||||
}
|
||||
}
|
||||
if ( !$this->enabled() ) {
|
||||
if ( ! $this->enabled() ) {
|
||||
$this->error = true;
|
||||
$this->errorMessage = 'Database disabled in config.';
|
||||
}
|
||||
if ( $this->error === false ) {
|
||||
try {
|
||||
Debug::debug( 'Attempting to connect to DB with config credentials.' );
|
||||
$this->pdo = new PDO( 'mysql:host=' . Config::getValue( 'database/dbHost' ) . ';dbname=' . Config::getValue( 'database/dbName' ), Config::getValue( 'database/dbUsername' ), Config::getValue( 'database/dbPassword' ) );
|
||||
$this->pdo = new PDO(
|
||||
'mysql:host=' . Config::getValue( 'database/dbHost' ) .
|
||||
';dbname=' . Config::getValue( 'database/dbName' ),
|
||||
Config::getValue( 'database/dbUsername' ),
|
||||
Config::getValue( 'database/dbPassword' )
|
||||
);
|
||||
} catch ( PDOException $Exception ) {
|
||||
$this->error = true;
|
||||
$this->errorMessage = $Exception->getMessage();
|
||||
|
Reference in New Issue
Block a user