Add missing semicolon

Fixes #7
This commit is contained in:
Miguel Nogueira
2018-06-08 16:44:33 +00:00
parent c9d71b422a
commit 50f811e5ec
3 changed files with 493 additions and 6 deletions

View File

@@ -30,22 +30,33 @@ class Application
try
{
$connection = \ParagonIE\EasyDB\Factory::create(
// FIXME: Find hidden bug ($Conn is null)
$Conn = \ParagonIE\EasyDB\Factory::create(
'mysql:host=' . $this->database['hostname'] . ';dbname=' . $this->database['dbname'],
$this->database['username'],
$this->database['password']
);
if (is_null($Conn))
{
throw new Exception("ERROR! There is no usable connection object.");
}
}
catch (ConstructorFailed $Ex)
{
header("HTTP/1.1 500 Internal Server Error");
exit("An error has ocurred and therefore we are unable to fulfill your request for information. Sorry.");
Analog::log("ALARM! Database connection failed! Message from Wrapper: " . $Ex->getMessage(), Analog::ALERT);
}
catch (Exception $ConEx)
{
Analog::log("ALERT! Unstable DB connection", Analog::ALERT);
}
finally
{
return $connection;
Analog::log("Returning DB connection\n" . var_dump($Conn), Analog::DEBUG);
return $Conn;
}
}