Skip to content

Commit

Permalink
Merge pull request #378 from roshanbudhathoki/fix/flag-to-disable-str…
Browse files Browse the repository at this point in the history
…igify-pdo-mysql

added setting to disable automatic strigify of pdo mysql
  • Loading branch information
develart-projects authored Sep 19, 2023
2 parents d5f9151 + 2307028 commit d9ef42a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions library/Zend/Db/Adapter/Pdo/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ abstract class Zend_Db_Adapter_Pdo_Abstract extends Zend_Db_Adapter_Abstract
* @see https:/php/php-src/commit/990bb34891c83d12c5129fd781893704f948f2f4
*/
public static $isTransactionInBackwardCompatibleMode = true;
public static $isPdoStringifyFetchesBackwardCompatiblePhp8 = true;


/**
* PDO type.
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Adapter/Pdo/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function _connect()
$this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_INIT_COMMAND
}

if (PHP_VERSION_ID >= 80100) {
if (PHP_VERSION_ID >= 80100 && Zend_Db_Adapter_Pdo_Abstract::$isPdoStringifyFetchesBackwardCompatiblePhp8) {
// ensure $config['driver_options'] is an array
$this->_config['driver_options'] = $this->_config['driver_options'] ?? [];
if (!isset($this->_config['driver_options'][PDO::ATTR_STRINGIFY_FETCHES])) {
Expand Down

0 comments on commit d9ef42a

Please sign in to comment.