"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/base/ErrorHandler.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

ErrorHandler.php  (yii2-2.0.35):ErrorHandler.php  (yii2-2.0.36)
skipping to change at line 44 skipping to change at line 44
* @var int the size of the reserved memory. A portion of memory is pre-allo cated so that * @var int the size of the reserved memory. A portion of memory is pre-allo cated so that
* when an out-of-memory issue occurs, the error handler is able to handle t he error with * when an out-of-memory issue occurs, the error handler is able to handle t he error with
* the help of this reserved memory. If you set this value to be 0, no memor y will be reserved. * the help of this reserved memory. If you set this value to be 0, no memor y will be reserved.
* Defaults to 256KB. * Defaults to 256KB.
*/ */
public $memoryReserveSize = 262144; public $memoryReserveSize = 262144;
/** /**
* @var \Exception|null the exception that is being handled currently. * @var \Exception|null the exception that is being handled currently.
*/ */
public $exception; public $exception;
/**
* @var bool if true - `handleException()` will finish script with `ExitCode
::OK`.
* false - `ExitCode::UNSPECIFIED_ERROR`.
* @since 2.0.36
*/
public $silentExitOnException;
/** /**
* @var string Used to reserve memory for fatal error handler. * @var string Used to reserve memory for fatal error handler.
*/ */
private $_memoryReserve; private $_memoryReserve;
/** /**
* @var \Exception from HHVM error that stores backtrace * @var \Exception from HHVM error that stores backtrace
*/ */
private $_hhvmException; private $_hhvmException;
/** /**
* @var bool whether this instance has been registered using `register()` * @var bool whether this instance has been registered using `register()`
*/ */
private $_registered = false; private $_registered = false;
public function init()
{
$this->silentExitOnException = $this->silentExitOnException !== null ? $
this->silentExitOnException : YII_ENV_TEST;
parent::init();
}
/** /**
* Register this error handler. * Register this error handler.
* @since 2.0.32 this will not do anything if the error handler was already registered * @since 2.0.32 this will not do anything if the error handler was already registered
*/ */
public function register() public function register()
{ {
if (!$this->_registered) { if (!$this->_registered) {
ini_set('display_errors', false); ini_set('display_errors', false);
set_exception_handler([$this, 'handleException']); set_exception_handler([$this, 'handleException']);
if (defined('HHVM_VERSION')) { if (defined('HHVM_VERSION')) {
skipping to change at line 123 skipping to change at line 135
if (PHP_SAPI !== 'cli') { if (PHP_SAPI !== 'cli') {
http_response_code(500); http_response_code(500);
} }
try { try {
$this->logException($exception); $this->logException($exception);
if ($this->discardExistingOutput) { if ($this->discardExistingOutput) {
$this->clearOutput(); $this->clearOutput();
} }
$this->renderException($exception); $this->renderException($exception);
if (!YII_ENV_TEST) { if (!$this->silentExitOnException) {
\Yii::getLogger()->flush(true); \Yii::getLogger()->flush(true);
if (defined('HHVM_VERSION')) { if (defined('HHVM_VERSION')) {
flush(); flush();
} }
exit(1); exit(1);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
// an other exception could be thrown while displaying the exception // an other exception could be thrown while displaying the exception
$this->handleFallbackExceptionMessage($e, $exception); $this->handleFallbackExceptionMessage($e, $exception);
} catch (\Throwable $e) { } catch (\Throwable $e) {
 End of changes. 3 change blocks. 
1 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)