diff --git a/components/support/.env b/components/support/.env new file mode 100644 index 0000000..a81955e --- /dev/null +++ b/components/support/.env @@ -0,0 +1,2 @@ +ENV_TEST_1=42 +ENV_TEST_2="forty-two" diff --git a/components/support/composer.json b/components/support/composer.json index 6ffcf88..a164bd0 100644 --- a/components/support/composer.json +++ b/components/support/composer.json @@ -4,6 +4,7 @@ "illuminate/support": "^8.0", "slim/psr7": "1.2.*", "slim/slim": "4.*", - "zeuxisoo/slim-whoops": "0.7.*" + "zeuxisoo/slim-whoops": "0.7.*", + "vlucas/phpdotenv": "^5.3" } } diff --git a/components/support/index.php b/components/support/index.php index cff98c6..bcea18f 100644 --- a/components/support/index.php +++ b/components/support/index.php @@ -1,6 +1,7 @@ load(); + // Middleware $app->add(new WhoopsMiddleware(['enable' => true])); -$app->get('/', function (Request $request, Response $response) { +$app->get('/', function (Request $request, Response $response) use ($env) { // MessageBag init $messageBag = new MessageBag; @@ -117,6 +122,16 @@ $response->getBody()->write(" - $message\n"); } + $response->getBody()->write('
'); + + foreach ($env as $k => $v) { + $response->getBody()->write("{$k}: " . env($k) . "\n"); + } + return $response; });