Skip to content

Commit

Permalink
Update connect error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
h2lsoft authored Nov 9, 2020
1 parent 35e19d0 commit ed5d189
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/DBManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ public function connect($driver='mysql', $host='localhost', $username='root', $p
{
$dsn = "{$driver}:host={$host};dbname={$database};port={$port}";

set_exception_handler(array(__CLASS__, 'exception_handler'));
error_interceptor(1);
$this->connection = new PDO($dsn, $username, $password, $pdo_options);
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

restore_exception_handler();
error_interceptor(0);

return $this->connection;
}
Expand Down

0 comments on commit ed5d189

Please sign in to comment.