Skip to content
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

Several fixes for usage with php 7.3 #9

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/Zend/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,14 @@ public static function loadFile($filename, $dirs = null, $once = false)
/**
* Try finding for the plain filename in the include_path.
*/
// "@":
// - Avoid error-logs full of PHP Warnings due to autoloads from class-exists()-checks.
// - If a class does not exist that we really need, error will be thrown anyway.
// - Fatal errors from the included files are still thrown anyway.
if ($once) {
include_once $filename;
@include_once $filename;
} else {
include $filename;
@include $filename;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ public static function setSaveHandler(Zend_Session_SaveHandler_Interface $saveHa
array(&$saveHandler, 'destroy'),
array(&$saveHandler, 'gc')
);
register_shutdown_function('session_write_close');

if (!$result) {
throw new Zend_Session_Exception('Unable to set session handler');
Expand Down Expand Up @@ -369,7 +370,7 @@ public static function rememberUntil($seconds = 0)
return;
}

if (!self::sessionExists()) { // session_set_cookie_params(): Cannot change session cookie parameters when session is active
if (!self::$_sessionStarted) { // session_set_cookie_params(): Cannot change session cookie parameters when session is active
$cookieParams = session_get_cookie_params();
session_set_cookie_params(
$seconds,
Expand Down
17 changes: 5 additions & 12 deletions library/Zend/Session/SaveHandler/DbTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ public function read($id)
*/
public function write($id, $data)
{
$return = false;

$data = array($this->_modifiedColumn => time(),
$this->_dataColumn => (string) $data);

Expand All @@ -348,17 +346,17 @@ public function write($id, $data)
$data[$this->_lifetimeColumn] = $this->_getLifetime($rows->current());

if ($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
$return = true;
return true;
}
} else {
$data[$this->_lifetimeColumn] = $this->_lifetime;

if ($this->insert(array_merge($this->_getPrimary($id, self::PRIMARY_TYPE_ASSOC), $data))) {
$return = true;
return true;
}
}

return $return;
return false;
}

/**
Expand All @@ -369,13 +367,8 @@ public function write($id, $data)
*/
public function destroy($id)
{
$return = false;

if ($this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
$return = true;
}

return $return;
$this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE));
return true; //always return true, since if nothing can be deleted, it is already deleted and thats OK.
}

/**
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Test/PHPUnit/ControllerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
/**
* Functional testing scaffold for MVC applications
*
* @uses PHPUnit_Framework_TestCase
* @uses PHPUnit\Framework\TestCase
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_TestCase
abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit\Framework\TestCase
{
/**
* @var mixed Bootstrap file path or callback
Expand Down Expand Up @@ -120,7 +120,7 @@ public function __get($name)
*
* Calls {@link bootstrap()} by default
*/
protected function setUp()
protected function setUp(): void
{
$this->bootstrap();
}
Expand Down