Class AkRequest

(line 46)

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.



Class Variables

Summary:
mixed $action
mixed $controller
array $env
mixed $view
mixed $_init_check

$action = AK_DEFAULT_ACTION (line 64)

Data type : mixed

$controller = AK_DEFAULT_CONTROLLER (line 65)

Data type : mixed

$env = array() (line 73)

Data type : array

Holds information about current environment. Initially a reference to $_SERVER

$view (line 66)

Data type : mixed

$_init_check = false (line 61)

Data type : mixed

$__internationalization_support_enabled = false (line 62)

Data type : mixed

Class Constants

Summary:

Method Detail

Summary:
AkRequest __construct ()
void checkForRoutedRequests ( &$Router)
void get ( $var_name)
void getAction ()
void getController ()
void &getCookies ()
void getDomain ([ $tld_length = 1])
void &getEnv ()
void getHost ()
void getHostWithPort ()
void getMethod ()
void getParameters ()
void getParams ()
void getPath ()
void getPort ()
void getPortString ()
void getProtocol ()
void getPutParams ()
void getRawPost ()
void getRemoteIp ()
void getRequestUri ()
void &getSession ()
void getStandardPort ()
void getSubdomains ([ $tld_length = 1])
void getUrlParams ()
void init ()
void isAjax ()
void isDelete ()
void isGet ()
void isHead ()
void isPost ()
void isPut ()
void isSsl ()
void isValidActionName ( $action_name)
void isValidControllerName ( $controller_name)
void isValidModuleName ( $module_name)
AkActionController &recognize ([ $Map = null])
void reset ()
void resetSession ()
void set ( $variable,  $value)
void setPathParameters ( $parameters)
void xhr ()
void _fixGpc ( &$item)
void _fixGpcMagic ()
void _getNormalizedFilesArray ([ $params = null], [ $first_call = true])
void _mapRoutes ([ $Map = null])
void _mergeRequest ()
array _parseAkRequestString ( $ak_request_string, [ $pattern = '/'])
void _performUrlDecode ( &$item)
void _startSession ()
void _urlDecode ()
void _validateTechName ( $name)

Constructor __construct (line 104)

AkRequest __construct( )

Overrides : AkObject::__construct() Class constructor, overriden in descendant classes

Info

Method checkForRoutedRequests (line 176)

void checkForRoutedRequests( &$Router)

Parameters

  • &$Router:

Info

Method get (line 144)

void get( $var_name)

Parameters

  • $var_name:

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

  • $tld_length:

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

  • $tld_length:

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

  • $action_name:

Info

Method isValidControllerName (line 213)

void isValidControllerName( $controller_name)

Parameters

  • $controller_name:

Info

Method isValidModuleName (line 223)

void isValidModuleName( $module_name)

Parameters

  • $module_name:

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)

AkActionController &recognize( [ $Map = null])

Recognizes a Request and returns the responsible controller instance

Parameters

  • $Map:

Info

Method reset (line 164)

void reset( )

Info

Method resetSession (line 468)

void resetSession( )

Info

Method set (line 170)

void set( $variable, $value)

Parameters

  • $variable:
  • $value:

Info

Method setPathParameters (line 241)

void setPathParameters( $parameters)

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

  • &$item:

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

  • $params:
  • $first_call:

Info

Method _mapRoutes (line 774)

void _mapRoutes( [ $Map = null])

Parameters

  • $Map:

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&paramN=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

  • access - public

Method _performUrlDecode (line 685)

void _performUrlDecode( &$item)

Parameters

  • &$item:

Info

Method _startSession (line 796)

void _startSession( )

Info

Method _urlDecode (line 677)

void _urlDecode( )

Info

Method _validateTechName (line 527)

void _validateTechName( $name)

Parameters

  • $name:

Info

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary

Inherited From Class AkObject

AkObject::AkObject() - A hack to support __construct() on PHP 4

AkObject::__construct() - Class constructor, overriden in descendant classes

AkObject::freeMemory() - Unsets circular reference children that are not freed from memory when calling unset() or when the parent object is garbage collected.

AkObject::log() -

AkObject::toString() - Object-to-string conversion

AkObject::__clone() - Clone class (Zend Engine 2 compatibility trick)

AkObject::__destruct() - Class destructor, overriden in descendant classes

AkObject::__toString() -



Documentation generated on Tue, 17 Jun 2008 14:26:37 +0200 by phpDocumentor 1.3.2