My application need to use database instead of file for the session management. My Application is based on Zend Framework
The issue is written here: https://github.com/zendframework/zf1/issues/665#issue-127528467
Since an update that returns 0 but doesn't throw an exception was still a successful query with no error
Hence the function write
will return false
instead of true
, and PHP 7.0 requires a true
result.
You can fix this by changing, in Zend/Session/SaveHandler/DbTable.php
:
if ($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
To:
if (is_int($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE)))) {
Or you can also remove the if
, turn it into an instruction, and keep the $return = true;
. Because on error, the query should raise an Exception, so any update()
without Exception is good.