Skip to content

Commit

Permalink
Strict error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LionelLaffineur committed Aug 10, 2018
1 parent 9e5d6f2 commit 9a06fc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Skeleton/Database/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function __construct($dsn) {
* @throws Exception Throws an Exception when the Database is unavailable
*/
public function connect() {
mysqli_report(MYSQLI_REPORT_STRICT);
$settings = parse_url($this->dsn);

// If we can't even parse the DSN, don't bother
Expand All @@ -74,7 +75,7 @@ public function connect() {
}

$settings['path'] = substr($settings['path'], 1);
$this->database = new \Mysqli($settings['host'], $settings['user'], $settings['pass'], $settings['path']);
$this->database = @new \Mysqli($settings['host'], $settings['user'], $settings['pass'], $settings['path']);

// If there is an error connecting to the database, stop doing what you're doing
if ($this->database->connect_errno != 0) {
Expand Down

0 comments on commit 9a06fc2

Please sign in to comment.