Description
AkObject
|
--AkRequest
Located in File: /AkRequest.php
Class that handles incoming request.
The Request Object handles user request (CLI, GET, POST, session or cookie requests), transforms it and sets it up for the ApplicationController class, who takes control of the data flow.
- author: - Bermi Ferrer <bermi@akelos.com>
- copyright: - Copyright (c) 2002-2005, Akelos Media, S.L. http://www.akelos.org
- license: - GNU
Method Detail
Summary:
void
set
(
$variable,
$value)
Constructor __construct (line 104)
AkRequest __construct(
)
Overrides : AkObject::__construct() Class constructor, overriden in descendant classes
Info
Method checkForRoutedRequests (line 176)
void checkForRoutedRequests(
&$Router)
Parameters
Info
Method get (line 144)
void get(
$var_name)
Parameters
Info
Method getAction (line 154)
void getAction(
)
Info
Method getController (line 159)
void getController(
)
Info
Method getCookies (line 473)
void &getCookies(
)
Info
Method getDomain (line 367)
void getDomain(
[
$tld_length = 1])
Returns the domain part of a host, such as akelos.com in 'www.akelos.com'. You can specify a different <tt>tld_length</tt>, such as 2 to catch akelos.co.uk in 'www.akelos.co.uk'.
Parameters
Info
Method getEnv (line 479)
void &getEnv(
)
Info
Method getHost (line 455)
void getHost(
)
Info
Method getHostWithPort (line 449)
void getHostWithPort(
)
Returns a host:port string for this request, such as example.com or example.com:8080.
Info
Method getLocaleFromUrl (line 277)
void getLocaleFromUrl(
)
Returns the locale identifier of current URL
Info
Method getMethod (line 289)
void getMethod(
)
Returns the HTTP request method as a lowercase symbol ('get, for example)
Info
Method getParameters (line 233)
void getParameters(
)
Returns both GET and POST parameters in a single array.
Info
Method getParams (line 149)
void getParams(
)
Info
Method getPath (line 413)
void getPath(
)
Returns the interpreted path to requested resource
Info
Method getPathParameters (line 246)
void getPathParameters(
)
Info
Method getPort (line 421)
void getPort(
)
Returns the port number of this request as an integer.
Info
Method getPortString (line 439)
void getPortString(
)
Returns a port suffix like ':8080' if( the port number of this request is not the default HTTP port 80 or HTTPS port 443.
Info
Method getProtocol (line 397)
void getProtocol(
)
Return 'https://' if( this is an SSL request and 'http://' otherwise.
Info
Method getPutParams (line 819)
void getPutParams(
)
Info
Method getPutRequestData (line 828)
void getPutRequestData(
)
Info
Method getQueryParameters (line 259)
void getQueryParameters(
)
Must be implemented in the concrete request
Info
Method getRawPost (line 521)
void getRawPost(
)
Receive the raw post data.
This is useful for services such as REST, XMLRPC and SOAP which communicate over HTTP POST but don't use the traditional parameter format.
Info
Method getRelativeUrlRoot (line 269)
void getRelativeUrlRoot(
)
Returns the path minus the web server relative installation directory. This method returns null unless the web server is apache.
Info
Method getRemoteIp (line 344)
void getRemoteIp(
)
Determine originating IP address. REMOTE_ADDR is the standard
but will fail if( the user is behind a proxy. HTTP_CLIENT_IP and/or HTTP_X_FORWARDED_FOR are set by proxies so check for these before falling back to REMOTE_ADDR. HTTP_X_FORWARDED_FOR may be a comma- delimited list in the case of multiple chained proxies; the first is the originating IP.
Info
Method getRequestParameters (line 262)
void getRequestParameters(
)
Info
Method getRequestUri (line 389)
void getRequestUri(
)
Returns the request URI correctly
Info
Method getServerSoftware (line 485)
void getServerSoftware(
)
Info
Method getSession (line 463)
void &getSession(
)
Info
Method getStandardPort (line 430)
void getStandardPort(
)
Returns the standard port number for this request's protocol
Info
Method getSubdomains (line 379)
void getSubdomains(
[
$tld_length = 1])
Returns all the subdomains as an array, so ['dev', 'www'] would be returned for 'dev.www.akelos.com'.
You can specify a different <tt>tld_length</tt>, such as 2 to catch ['www'] instead of ['www', 'akelos'] in 'www.akelos.co.uk'.
Parameters
Info
Method getUrlParams (line 251)
void getUrlParams(
)
Info
Method init (line 120)
void init(
)
Initialization method.
Initialization method. Use this via the class constructor.
Info
- access - public
- uses - parseRequest
Method isAjax (line 510)
void isAjax(
)
Info
Method isDelete (line 321)
void isDelete(
)
Is this a DELETE request? Equivalent to $Request->getMethod() == 'delete'
Info
Method isGet (line 297)
void isGet(
)
Is this a GET request? Equivalent to $Request->getMethod() == 'get'
Info
Method isHead (line 329)
void isHead(
)
Is this a HEAD request? Equivalent to $Request->getMethod() == 'head'
Info
Method isPost (line 305)
void isPost(
)
Is this a POST request? Equivalent to $Request->getMethod() == 'post'
Info
Method isPut (line 313)
void isPut(
)
Is this a PUT request? Equivalent to $Request->getMethod() == 'put'
Info
Method isSsl (line 405)
void isSsl(
)
Is this an SSL request?
Info
Method isValidActionName (line 218)
void isValidActionName(
$action_name)
Parameters
Info
Method isValidControllerName (line 213)
void isValidControllerName(
$controller_name)
Parameters
Info
Method isValidModuleName (line 223)
void isValidModuleName(
$module_name)
Parameters
Info
Method isXmlHttpRequest (line 501)
void isXmlHttpRequest(
)
Returns true if the request's 'X-Requested-With' header contains
'XMLHttpRequest'. (The Prototype Javascript library sends this header with every Ajax request.)
Info
Method recognize (line 702)
Recognizes a Request and returns the responsible controller instance
Parameters
Info
Method reset (line 164)
void reset(
)
Info
Method resetSession (line 468)
void resetSession(
)
Info
Method set (line 170)
void set(
$variable,
$value)
Parameters
Info
Method setPathParameters (line 241)
void setPathParameters(
$parameters)
Parameters
Info
Method xhr (line 505)
void xhr(
)
Info
Method _connectToDatabase (line 789)
void _connectToDatabase(
)
Info
Method _enableInternationalizationSupport (line 762)
void _enableInternationalizationSupport(
)
Info
Method _fixGpc (line 667)
void _fixGpc(
&$item)
Parameters
Info
Method _fixGpcMagic (line 655)
void _fixGpcMagic(
)
Correct double-escaping problems caused by "magic quotes" in some PHP installations.
Info
Method _getNormalizedFilesArray (line 565)
void _getNormalizedFilesArray(
[
$params = null], [
$first_call = true])
Parameters
Info
Method _mapRoutes (line 774)
void _mapRoutes(
[
$Map = null])
Parameters
Info
Method _mergeRequest (line 548)
void _mergeRequest(
)
Populates $this->_request attribute with incoming request in the following precedence:
$_SESSION['request'] <- This will override options provided by previous methods $_COOKIE $_POST $_GET Command line params
Info
- return - Void returned. Modifies the private property "
- access - public
Method _parseAkRequestString (line 93)
array _parseAkRequestString(
$ak_request_string, [
$pattern = '/'])
String parse method.
This method gets a petition as parameter, using the "Ruby on Rails" request format (see prettyURL in RoR documentation). The format is: file.php?ak=/controller/action/id¶mN=valueN
This method requires for a previous execution of the _mergeRequest() method, in order to merge all the request all i one array.
This method expands dynamically the class Request, adding a public property for every parameter sent in the request.
Parameters
- $ak_request_string:
- $pattern:
Info
Method _performUrlDecode (line 685)
void _performUrlDecode(
&$item)
Parameters
Info
Method _startSession (line 796)
void _startSession(
)
Info
Method _urlDecode (line 677)
void _urlDecode(
)
Info
Method _validateTechName (line 527)
void _validateTechName(
$name)
Parameters
Info