-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for PHP 8.1 compatibility #40
Fixes for PHP 8.1 compatibility #40
Conversation
e010510
to
95f04f4
Compare
95f04f4
to
72bc347
Compare
469212b
to
5364d08
Compare
2685e14
to
59ddff2
Compare
59ddff2
to
a79c8ec
Compare
@@ -134,14 +134,17 @@ protected function _prepare($sql) | |||
*/ | |||
protected function _parseParameters($sql) | |||
{ | |||
$sql = $this->_stripQuoted($sql); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend leaving it as it is
// split into text and params | ||
$this->_sqlSplit = preg_split('/(\?|\:[a-zA-Z0-9_]+)/', | ||
$sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); | ||
if ($sql !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will the following foreach
be executed if $sql === null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -134,7 +132,6 @@ public function getExtension() | |||
*/ | |||
public function setExtension($extension) | |||
{ | |||
$this->_extension = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
$this->_extension = '';
is more appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @fascinosum
The property $_extension
is ''
by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only right after initialization of the object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
library/Zend/Db/Statement/Pdo.php
Outdated
@@ -245,7 +245,7 @@ public function _execute(array $params = null) | |||
* @return mixed Array, object, or scalar depending on fetch mode. | |||
* @throws Zend_Db_Statement_Exception | |||
*/ | |||
public function fetch($style = null, $cursor = null, $offset = null) | |||
public function fetch($style = null, $cursor = PDO::FETCH_ORI_NEXT, $offset = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move these operations to the method code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @fascinosum , done
bbbc1c8
to
438053d
Compare
Description (*)
Issues were found when trying to launch Magento, and running Unit Tests, on php-8.1. env.
This PR is fixing Zend code to be compatible with PHP 8.1.
Related Pull Requests
Related Issues