Commit ab003354 by Alexander Makarov

Fixes #6247: Logger and error handler are now using slightly less memory

parent 3b9dd7f4
...@@ -5,6 +5,7 @@ Yii Framework 2 Change Log ...@@ -5,6 +5,7 @@ Yii Framework 2 Change Log
----------------------- -----------------------
- Bug #6404: advanced application template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller) - Bug #6404: advanced application template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller)
- Enh #6247: Logger and error handler are now using slightly less memory (stepanselyuk, samdark)
- Enh #6434: Added `yii\behaviors\SluggableBehavior::immutable` to support keeping the generated slug unchanged (trntv) - Enh #6434: Added `yii\behaviors\SluggableBehavior::immutable` to support keeping the generated slug unchanged (trntv)
- Enh #6467: `ActiveForm` will scroll to the nearest visible element when the first error input is hidden (newartix) - Enh #6467: `ActiveForm` will scroll to the nearest visible element when the first error input is hidden (newartix)
......
...@@ -140,7 +140,7 @@ abstract class ErrorHandler extends Component ...@@ -140,7 +140,7 @@ abstract class ErrorHandler extends Component
$exception = new ErrorException($message, $code, $code, $file, $line); $exception = new ErrorException($message, $code, $code, $file, $line);
// in case error appeared in __toString method we can't throw any exception // in case error appeared in __toString method we can't throw any exception
$trace = debug_backtrace(0); $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
array_shift($trace); array_shift($trace);
foreach ($trace as $frame) { foreach ($trace as $frame) {
if ($frame['function'] == '__toString') { if ($frame['function'] == '__toString') {
......
...@@ -138,7 +138,7 @@ class Logger extends Component ...@@ -138,7 +138,7 @@ class Logger extends Component
$traces = []; $traces = [];
if ($this->traceLevel > 0) { if ($this->traceLevel > 0) {
$count = 0; $count = 0;
$ts = debug_backtrace(); $ts = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
array_pop($ts); // remove the last trace since it would be the entry script, not very useful array_pop($ts); // remove the last trace since it would be the entry script, not very useful
foreach ($ts as $trace) { foreach ($ts as $trace) {
if (isset($trace['file'], $trace['line']) && strpos($trace['file'], YII2_PATH) !== 0) { if (isset($trace['file'], $trace['line']) && strpos($trace['file'], YII2_PATH) !== 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment