Skip to content

Commit 9a06fc2

Browse files
Strict error handling
1 parent 9e5d6f2 commit 9a06fc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Skeleton/Database/Proxy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct($dsn) {
6161
* @throws Exception Throws an Exception when the Database is unavailable
6262
*/
6363
public function connect() {
64+
mysqli_report(MYSQLI_REPORT_STRICT);
6465
$settings = parse_url($this->dsn);
6566

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

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

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

0 commit comments

Comments
 (0)