diff --git a/library/Zend/Loader.php b/library/Zend/Loader.php index 40da3bfaa2..d5a28753b4 100644 --- a/library/Zend/Loader.php +++ b/library/Zend/Loader.php @@ -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; } /** diff --git a/library/Zend/Session.php b/library/Zend/Session.php index da4f8830a3..86c4485762 100644 --- a/library/Zend/Session.php +++ b/library/Zend/Session.php @@ -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'); @@ -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, diff --git a/library/Zend/Session/SaveHandler/DbTable.php b/library/Zend/Session/SaveHandler/DbTable.php index e423a18d4c..facc224886 100644 --- a/library/Zend/Session/SaveHandler/DbTable.php +++ b/library/Zend/Session/SaveHandler/DbTable.php @@ -337,8 +337,6 @@ public function read($id) */ public function write($id, $data) { - $return = false; - $data = array($this->_modifiedColumn => time(), $this->_dataColumn => (string) $data); @@ -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; } /** @@ -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. } /** diff --git a/library/Zend/Test/PHPUnit/ControllerTestCase.php b/library/Zend/Test/PHPUnit/ControllerTestCase.php index 69976f0d93..e0afbc35b0 100644 --- a/library/Zend/Test/PHPUnit/ControllerTestCase.php +++ b/library/Zend/Test/PHPUnit/ControllerTestCase.php @@ -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 @@ -120,7 +120,7 @@ public function __get($name) * * Calls {@link bootstrap()} by default */ - protected function setUp() + protected function setUp(): void { $this->bootstrap(); }