1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +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 () {
$env = \getenv("AMP_DEBUG");
$env = \getenv("AMP_DEBUG") ?: "0";
if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) {
$trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
\array_shift($trace); // remove current closure

View File

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