From b085ecd88809afd13f14688fafb36708c16e215f Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 7 Apr 2011 05:11:16 +0000 Subject: [PATCH] Added more properties to Request object --- flight/Flight.php | 2 +- flight/Request.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/flight/Flight.php b/flight/Flight.php index 84a239b..f5056ac 100644 --- a/flight/Flight.php +++ b/flight/Flight.php @@ -437,7 +437,7 @@ class Flight { } // Disable caching for AJAX requests - if (self::request()->isAjax) { + if (self::request()->ajax) { self::response()->cache(false); } diff --git a/flight/Request.php b/flight/Request.php index 0a74e57..44dd005 100644 --- a/flight/Request.php +++ b/flight/Request.php @@ -20,8 +20,13 @@ class Request { 'base' => str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])), 'method' => $_SERVER['REQUEST_METHOD'], 'referrer' => $_SERVER['HTTP_REFERER'], - 'ipAddress' => $_SERVER['REMOTE_ADDR'], - 'isAjax' => ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'), + 'ip' => $_SERVER['REMOTE_ADDR'], + 'ajax' => ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'), + 'scheme' => $_SERVER['SERVER_PROTOCOL'], + 'user_agent' => $_SERVER['HTTP_USER_AGENT'], + 'body' => file_get_contents('php://input'), + 'type' => $_SERVER['CONTENT_TYPE'], + 'length' => $_SERVER['CONTENT_LENGTH'], 'query' => array(), 'data' => $_POST, 'cookies' => $_COOKIE,