1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00

Don't record stack traces in case of AMP_DEBUG not being set

Fixes #217.
This commit is contained in:
Niklas Keller 2018-04-21 21:32:48 +02:00
parent c632e40b03
commit 8399301b5b
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ trait Placeholder {
} }
\assert((function () { \assert((function () {
$env = \getenv("AMP_DEBUG"); $env = \getenv("AMP_DEBUG") ?: "0";
if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) { if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) {
$trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS); $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
\array_shift($trace); // remove current closure \array_shift($trace); // remove current closure

View File

@ -154,7 +154,7 @@ trait Producer {
} }
\assert((function () { \assert((function () {
$env = \getenv("AMP_DEBUG"); $env = \getenv("AMP_DEBUG") ?: "0";
if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) { if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) {
$trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS); $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
\array_shift($trace); // remove current closure \array_shift($trace); // remove current closure