mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-25 00:07:20 +00:00
docs: Comment on database.php about adding PDO::ATTR_STRINGIFY_FETCHES => true
flag in PHP 8.1
Comment on how to set up when using PDO MySQL/SQLite driver with connection flags unspecified and PHP 8.1 to keep the type when retrieving integer/float columns.
This commit is contained in:
parent
797b7e0a3c
commit
071b292969
1 changed files with 14 additions and 1 deletions
|
@ -49,7 +49,7 @@
|
||||||
* database. Uses database default not specified.
|
* database. Uses database default not specified.
|
||||||
*
|
*
|
||||||
* sslmode =>
|
* sslmode =>
|
||||||
* For Postgres specifies whether to 'disable', 'allow', 'prefer', or 'require' SSL for the
|
* For Postgres specifies whether to 'disable', 'allow', 'prefer', or 'require' SSL for the
|
||||||
* connection. The default value is 'allow'.
|
* connection. The default value is 'allow'.
|
||||||
*
|
*
|
||||||
* unix_socket =>
|
* unix_socket =>
|
||||||
|
@ -75,6 +75,15 @@ class DATABASE_CONFIG {
|
||||||
'database' => 'database_name',
|
'database' => 'database_name',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
//'encoding' => 'utf8',
|
//'encoding' => 'utf8',
|
||||||
|
|
||||||
|
// PDO MySQL/SQLite Driver had the following backward incompatible changes in PHP 8.1
|
||||||
|
// * https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.pdo.mysql
|
||||||
|
// * https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.pdo.sqlite
|
||||||
|
// If under PHP 8.1 and didn't use the following flags, adding them will cause integer and float columns
|
||||||
|
// in the result set to be strings as before.
|
||||||
|
// 'flags' => array(
|
||||||
|
// PDO::ATTR_STRINGIFY_FETCHES => true
|
||||||
|
// )
|
||||||
);
|
);
|
||||||
|
|
||||||
public $test = array(
|
public $test = array(
|
||||||
|
@ -86,5 +95,9 @@ class DATABASE_CONFIG {
|
||||||
'database' => 'test_database_name',
|
'database' => 'test_database_name',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
//'encoding' => 'utf8',
|
//'encoding' => 'utf8',
|
||||||
|
|
||||||
|
// 'flags' => array(
|
||||||
|
// PDO::ATTR_STRINGIFY_FETCHES => true
|
||||||
|
// )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue