PDO driver always throw exceptions on failed queries for develop mode (real fix) * better fix to pocketarc/codeigniter@8888916 that assumes alwasy in developer mode this co0udl leave a disgustin render in production * improvements over commit 00c3e9217d96139da4767636449a74cbfc8e982a previously
... | ... | @@ -65,9 +65,7 @@ class CI_DB_pdo_driver extends CI_DB { |
65 | 65 | *
|
66 | 66 | * @var array
|
67 | 67 | */
|
68 | - public $options = array(
|
|
69 | - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
70 | - );
|
|
68 | + public $options = array();
|
|
71 | 69 | |
72 | 70 | // --------------------------------------------------------------------
|
73 | 71 | |
... | ... | @@ -83,6 +81,8 @@ class CI_DB_pdo_driver extends CI_DB { |
83 | 81 | {
|
84 | 82 | parent::__construct($params);
|
85 | 83 | |
84 | + if(ENVIRONMENT !== 'production' && empty($options)) $this->$options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
|
|
85 | + |
|
86 | 86 | if (preg_match('/([^:]+):/', $this->dsn, $match) && count($match) === 2)
|
87 | 87 | {
|
88 | 88 | // If there is a minimum valid dsn string pattern found, we're done
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help