From a047e15f7e838e555a090caa978e20952779a6d4 Mon Sep 17 00:00:00 2001 From: Maarten Date: Thu, 13 Feb 2020 19:17:02 +0100 Subject: [PATCH] Add env method to request --- src/Runtime/Http/Request.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Runtime/Http/Request.php b/src/Runtime/Http/Request.php index b3bf252..cb25779 100644 --- a/src/Runtime/Http/Request.php +++ b/src/Runtime/Http/Request.php @@ -2,6 +2,7 @@ namespace Runtime\Http; +use Runtime\Config\Env; use Runtime\Exceptions\Exceptions\MalformedUrlException; use Runtime\Http\Input\InputHandler; use Runtime\Router\Route\ILoadableRoute; @@ -224,6 +225,16 @@ class Request return $this->inputHandler; } + /** + * Get env variable + * @param $key + * @return string + */ + public function getEnv($key) + { + return Env::get($key); + } + /** * Is format accepted *