[Git][codeigniterpower/codeigniterpower][master] PDO driver always throw exceptions on failed queries for develop mode (real fix)

0 views
Skip to first unread message

Герхард PICCORO Lenz McKAY (@mckaygerhard)

unread,
Feb 6, 2024, 10:46:55 AMFeb 6
to venenux...@googlegroups.com

Герхард PICCORO Lenz McKAY pushed to branch master at codeigniterpower / codeigniterpower

Commits:

  • e053596c
    by mckaygerhard at 2024-02-06T11:47:01-04:00
    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
    

1 changed file:

Changes:

  • appsys/database/drivers/pdo/pdo_driver.php
    ... ... @@ -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

Reply all
Reply to author
Forward
0 new messages