From 54440d1db0e2abd74a705ec5926a75572fed62fb Mon Sep 17 00:00:00 2001 From: Daniel Stelljes Date: Wed, 1 Oct 2014 19:46:03 -0500 Subject: [PATCH] Removed static body variable from Request --- flight/net/Request.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/flight/net/Request.php b/flight/net/Request.php index c2142e1..e9dac8e 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -120,11 +120,6 @@ class Request { */ public $proxy_ip; - /** - * @var mixed Data from the request body - */ - protected static $body; - /** * Constructor. * @@ -201,20 +196,20 @@ class Request { * * @return string Raw HTTP request body */ - public static function getBody() - { - if (!is_null(self::$body)) { - return self::$body; + public static function getBody() { + static $body; + + if (!is_null($body)) { + return $body; } - $body = ''; $method = self::getMethod(); if ($method == 'POST' || $method == 'PUT') { $body = file_get_contents('php://input'); } - return self::$body = $body; + return $body; } /**