Class SS_HTTPRequest
Represents a HTTP-request, including a URL that is tokenised for parsing, and
a request method (GET/POST/PUT/DELETE). This is used by RequestHandler
objects to decide what to do.
The intention is that a single SS_HTTPRequest object can be passed from one
object to another, each object calling match() to get the information that they
need out of the URL. This is generally handled by RequestHandler::handleRequest().
- SS_HTTPRequest implements ArrayAccess
Used by:
RequestHandler::handleRequest() Located at sapphire/core/control/HTTPRequest.php
Methods summary
public
|
#
__construct( mixed $httpMethod, mixed $url, mixed $getVars = array(), mixed $postVars = array(), mixed $body = null )
Construct a SS_HTTPRequest from a URL relative to the site root. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
array
|
#
requestVars( )
Returns all combined HTTP GET and POST parameters passed into this request. If a parameter with the same name exists in both arrays, the POST value is returned. |
public
|
|
public
|
|
public
|
|
public
string
|
#
getExtension( )
Returns a possible file extension found in parsing the URL as denoted by a
"."-character near the end of the URL. Doesn't necessarily have to belong to an
existing file, for example used for |
public
boolean
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
public
string
|
|
public
boolean
|
#
offsetExists( unknown_type $offset )
Enables the existence of a key-value pair in the request to be checked using array syntax, so isset($request['title']) will check for $_POST['title'] and $_GET['title'] |
public
unknown
|
|
public static
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
#
isEmptyPattern( mixed $pattern )
Returns true if this is a URL that will match without shifting off any of the URL. This is used by the request handler to prevent infinite parsing loops. |
public
|
|
public
|
|
public
string
|
|
public
array
|
#
getAcceptMimetypes( boolean $includeQuality = false )
Returns all mimetypes from the HTTP "Accept" header as an array. |
public
string
|
|
public static
string
|
Methods inherited from ArrayAccess
Magic methods summary
Properties summary
protected
string
|
$url |
#
$url |
protected
mixed
|
$dirParts |
#
The non-extension parts of the passed URL as an array, originally exploded by
the "/" separator. All elements of the URL are loaded in here, and subsequently
popped out of the array by |
protected
string
|
$extension |
#
$extension The URL extension (if present) |
protected
string
|
$httpMethod |
#
$httpMethod The HTTP method in all uppercase: GET/PUT/POST/DELETE/HEAD |
protected
array
|
$getVars |
#
$getVars Contains alls HTTP GET parameters passed into this request. |
protected
array
|
$postVars |
#
$postVars Contains alls HTTP POST parameters passed into this request. |
protected
array
|
$headers |
#
HTTP Headers like "Content-Type: text/xml" |
protected
string
|
$body |
#
Raw HTTP body, used by PUT and POST requests. |
protected
array
|
$allParams |
#
$allParams Contains an assiciative array of all arguments matched in all calls to RequestHandler->handleRequest(). It's a "historical record" that's specific to the current call of handleRequest(), and is only complete once the "last call" to that method is made. |
protected
array
|
$latestParams |
#
$latestParams Contains an associative array of all arguments matched in the
current call from RequestHandler->handleRequest(), as denoted with a
"$"-prefix in the $url_handlers definitions. Contains different states
throughout its lifespan, so just useful while processed in |
protected
integer
|
$unshiftedButParsedParts |