Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only enable whoops when TASMO_DEBUG env var set #659

Merged
merged 1 commit into from Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -8,6 +8,7 @@ services:
- "8000:80"
environment:
- TASMO_DATADIR=/data/tasmoadmin/
- TASMO_DEBUG=1
volumes:
- ./tasmoadmin:/var/www/tasmoadmin
- ./.storage:/data/tasmoadmin
11 changes: 7 additions & 4 deletions tasmoadmin/includes/bootstrap.php
Expand Up @@ -64,9 +64,12 @@
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;

$whoops = new Run;
$whoops->pushHandler(new PrettyPageHandler);
$whoops->register();
$debug = isset($_SERVER['TASMO_DEBUG']);
if ($debug) {
$whoops = new Run;
$whoops->pushHandler(new PrettyPageHandler);
$whoops->register();
}

if( !empty( $_REQUEST[ "clean" ] ) ) {
cleanTemps();
Expand All @@ -86,7 +89,7 @@
$Sonoff = new Sonoff();
$i18n = new i18n();

$lang = isset( $_GET[ "lang" ] ) ? $_GET[ "lang" ] : NULL;
$lang = $_GET["lang"] ?? NULL;
if( isset( $lang ) ) {
$_SESSION[ 'lang' ] = $lang;
header(
Expand Down