Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

$app = new \Slim\Slim();
$app->get('/', function () {
echo "Powered by " . ($_ENV["POWERED_BY"] ? $_ENV["POWERED_BY"] : "Deis") . "\n";
$container = trim(exec('hostname') ?: "unknown");
echo "Powered by " . (isset($_ENV["POWERED_BY"]) ? $_ENV['POWERED_BY'] : "Deis!") . "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was there something wrong with the current implementation that requires the call to isset() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bacongobbler it would throw a notice (unseen due to error display settings, but still happens) if the key didn't exist. This is just the correct way to do this.

echo "Running on container ID " . $container . "\n";
});
$app->run();

Expand Down