Phpfox_Request

Description

Creates a special request method which is used in the script instead of calling the default $_REQUEST methods. All requests are parsed and trimmed.

  • author: Raymond Benc
  • version: $Id: request.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/request/request.class.php (line 18)


	
			
Variable Summary
 static array $_aBrowser
 array $_aArgs
 array $_aMethod
 array $_aName
 string $_sName
Method Summary
 static bool isBrowser (string $sName, int $iVersion)
 Phpfox_Request __construct ()
 string get ([string $sName = ''], [ $mDef = ''], string $sCommand)
 array getArray (string $sName, [array $mDef = array()])
 string getBrowser ()
 void getIdHash ()
 int getInt (string $sName, [string $mDef = ''])
 string getIp ()
 array getRequests ()
 string getServer (string $sVar)
 string getServerUrl ([int $iId = ''])
 string getSessionHash ()
 string getSubstrIp (string $sIP, [ $iLength = null])
 object Returns is (string $sName)
 bool isIP (string $iIp)
 bool isMobile ()
 mixed send (string $sUrl, [array $aPost = array()], [string $sMethod = 'POST'], [string $sUserAgent = null], [string $aCookies = null])
 void set (mixed $mName, [string $sValue = null])
 mixed _trimData (mixed $mParam)
Variables
static array $_aBrowser = array() (line 61)

List of browsers.

  • access: private
array $_aArgs = array() (line 33)

List of all the requests ($_GET, $_POST, $_FILES etc...)

  • access: private
array $_aMethod = array() (line 26)

Variable is deprecated.

  • deprecated: 2.0.6
  • access: private
array $_aName = array() (line 40)

List of requests being checked.

  • access: private
bool $_bIsMobile = false (line 54)

Check to see if we are using a mobile device.

  • access: private
string $_sName (line 47)

Last name being checked.

  • access: private
Methods
static isBrowser (line 319)

Check if the user is using a specific browser and browser version.

  • return: TRUE on success, FALSE on failure.
  • access: public
bool isBrowser (string $sName, int $iVersion)
  • string $sName: Browser name.
  • int $iVersion: Browser version.
Constructor __construct (line 67)

Class Constructor used to build the variable $this->_aArgs.

  • access: public
Phpfox_Request __construct ()
get (line 95)

Retrieve parameter value from request.

  • return: parameter value
  • access: public
string get ([string $sName = ''], [ $mDef = ''], string $sCommand)
  • string $sName: name of argument
  • string $sCommand: is any extra commands we need to execute
  • $mDef
getArray (line 145)

Get a request and make sure it is an ARRAY.

  • return: Returns an ARRAY value.
  • access: public
array getArray (string $sName, [array $mDef = array()])
  • string $sName: Name of the request.
  • array $mDef: ARRAY of default values in case the request does not exist.
getBrowser (line 206)

Get the name of the browser being used.

  • access: public
string getBrowser ()
getIdHash (line 430)
  • access: public
void getIdHash ()
getInt (line 133)

Get a request and convert it into an INT.

  • return: INT value of the request.
  • access: public
int getInt (string $sName, [string $mDef = ''])
  • string $sName: Name of the request.
  • string $mDef: Default value in case the request does not exist.
getIp (line 356)

Fetches an alternate IP address of the current visitor, attempting to detect proxies etc.

  • access: public
string getIp ()
getRequests (line 155)

Get all the requests.

  • access: public
array getRequests ()
getServer (line 166)

Get specific server value. ($_SERVER)ยท

  • return: value.
  • access: public
string getServer (string $sVar)
  • string $sVar: Param name.
getServerUrl (line 330)

Get the servers URL based on the server ID you pass.

  • return: Full server URL.
  • access: public
string getServerUrl ([int $iId = ''])
  • int $iId: Server ID.
getSessionHash (line 440)

Fetches a valid sessionhash value, not necessarily the one tied to this session.

  • return: 32-character sessionhash
  • access: public
string getSessionHash ()
getSubstrIp (line 420)

Returns the IP address with the specified number of octets removed

  • return: Truncated IP address
  • access: public
string getSubstrIp (string $sIP, [ $iLength = null])
  • string $sIP: IP address
  • $iLength
is (line 78)

Checks to see if a request exists.

  • return: self object.
  • access: public
object Returns is (string $sName)
  • string $sName: Name of the request.
isIP (line 394)

Check to see if an IP is really an IP.

  • return: TRUE is a valid IP, FALSE is not a valid IP.
  • access: public
bool isIP (string $iIp)
  • string $iIp: IP to check.
isMobile (line 288)

Check to see if we are using a mobile device.

  • return: TRUE yes, FALSE no.
  • access: public
bool isMobile ()
send (line 455)

Send a request to another server. Usually using CURL.

  • return: FALSE if failed to connect, STRING if anything was returned from the server.
  • access: public
mixed send (string $sUrl, [array $aPost = array()], [string $sMethod = 'POST'], [string $sUserAgent = null], [string $aCookies = null])
  • string $sUrl: URL of the server.
  • array $aPost: $_POST data to send.
  • string $sMethod: Method of request (GET or POST).
  • string $sUserAgent: Useragent to send.
  • string $aCookies: ARRAY of any cookies to pass.
set (line 113)

Set a request manually.

  • access: public
void set (mixed $mName, [string $sValue = null])
  • mixed $mName: ARRAY include a name and value, STRING just the request name.
  • string $sValue: If the 1st argument is a string this must be the request value.
_trimData (line 582)

Trims params and strip slashes if magic_quotes_gpc is set.

  • return: trimmed params.
  • access: private
mixed _trimData (mixed $mParam)
  • mixed $mParam: request params

Documentation generated on Tue, 28 Sep 2010 10:36:43 +0200 by phpDocumentor 1.4.0a2