72 protected $additionalHeaders =
array(
'content-type',
'content-length',
'php-auth-user',
'php-auth-pw',
'auth-type',
'x-requested-with');
122 $this->method = isset(
$_SERVER[
'REQUEST_METHOD']) ?
$_SERVER[
'REQUEST_METHOD'] :
false;
124 $this->body = @file_get_contents(
'php://input');
125 $this->
get = self::stripSlashesIfMagicQuotes(
$_GET);
126 $this->
post = self::stripSlashesIfMagicQuotes(
$_POST);
139 return $this->method === self::METHOD_GET;
147 return $this->method === self::METHOD_POST;
155 return $this->method === self::METHOD_PUT;
163 return $this->method === self::METHOD_DELETE;
171 return $this->method === self::METHOD_HEAD;
179 return $this->method === self::METHOD_OPTIONS;
187 return ( $this->
params(
'isajax') || $this->
headers(
'X_REQUESTED_WITH') ===
'XMLHttpRequest' );
200 foreach (
array(
'put',
'post',
'get') as $dataSource ) {
201 $source = $this->$dataSource;
202 if ( isset($source[(
string)$key]) ) {
203 return $source[(
string)$key];
216 public function get( $key = null ) {
227 public function post( $key = null ) {
238 public function put( $key = null ) {
285 if ( !isset($this->contentType) ) {
289 $headerParts = preg_split(
'/\s*;\s*/',
$header);
328 return isset($array[(
string)$key]) ? $array[(
string)$key] : null;
337 if ( get_magic_quotes_gpc() ) {
338 return is_array($rawData) ? array_map(
array(
'self',
'stripSlashesIfMagicQuotes'), $rawData) : stripslashes($rawData);
349 if ( $this->
getContentType() ===
'application/x-www-form-urlencoded' ) {
350 $input = is_string($this->body) ? $this->body :
'';
351 if ( function_exists(
'mb_parse_str') ) {
368 foreach (
$_SERVER as $key => $value ) {
370 if ( strpos($key,
'http-') === 0 || in_array($key, $this->additionalHeaders) ) {
371 $name = str_replace(
'http-',
'', $key);
383 return str_replace(
'_',
'-', strtolower($name));
396 if ( isset($this->
post[self::METHOD_OVERRIDE]) ) {
397 $this->method = $this->
post[self::METHOD_OVERRIDE];
398 unset($this->
post[self::METHOD_OVERRIDE]);
399 if ( $this->
isPut() ) {
cookies( $key=null)
Fetch COOKIE value(s)
arrayValueForKey(array &$array, $key)
Fetch value from array.
isAjax()
Is this a XHR request?
isGet()
Is this a GET request?
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
checkForHttpMethodOverride()
Check for HTTP request method override.
arrayOrArrayValue(array &$array, $key=null)
Fetch array or array value.
convertHttpHeaderName( $name)
Convert HTTP header name.
isOptions()
Is this a OPTIONS request?
getContentType()
Get HTTP request content type.
getMethod()
Get HTTP method.
isHead()
Is this a HEAD request?
isDelete()
Is this a DELETE request?
Add rich text string
The name of the decorator.
getBody()
Get HTTP request body.
post( $key=null)
Fetch POST parameter(s)
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
getRootUri()
Get HTTP request root URI.
isPost()
Is this a POST request?
__construct()
Constructor.
getResourceUri()
Get HTTP request resource URI.
loadHttpHeaders()
Get HTTP request headers.
static stripSlashesIfMagicQuotes( $rawData)
Strip slashes from string or array of strings.
put( $key=null)
Fetch PUT parameter(s)
params( $key)
Fetch a PUT|POST|GET parameter value.
isPut()
Is this a PUT request?
Create styles array
The data for the language used.
headers( $key=null)
Get HTTP request header.
loadPutParameters()
Get PUT parameters.
static getBaseUri( $reload=false)
Get Base URI without trailing slash.
static getUri( $reload=false)
Get URI with leading slash.