class vB_Request_WebApi extends vB_Request_Web

Traits

Constants

COOKIE_SALT

Properties

protected int $timeNow UNIX timestamp at the creation of request from vB_Request
protected $ipAddress from vB_Request
protected $altIp from vB_Request
protected $sessionHost from vB_Request
protected $userAgent from vB_Request
protected $referrer from vB_Request
protected $languageid from vB_Request
protected string $sessionClass from vB_Request
protected vB_Session $session from vB_Request
$COOKIE_SALT from vB_Request_Web
protected $vBUrlScheme from vB_Request_Web
protected $vBUrlPath from vB_Request_Web
protected $vBUrlQuery from vB_Request_Web
protected $vBUrlQueryRaw from vB_Request_Web
protected $vBUrlClean from vB_Request_Web
protected $vBUrlWebroot from vB_Request_Web
protected $vBUrlBasePath from vB_Request_Web
protected $vBHttpHost from vB_Request_Web
protected $scriptPath from vB_Request_Web

Methods

__sleep()

No description

__wakeup()

No description

__construct()

No description

string
filter_ip($ip)

Validate the IP address (both ipv4 & ipv6)

string
getSessionClass()

Returns the name of session class associated to the request

createSession()

Creates a session based on client input

setSession(vB_Session $session)

Handles setting adding a newly created session to the request object

$session
createSessionForUser($userid)

Creates a session for a specific user

getTimeNow()

No description

getIpAddress()

No description

getAltIp()

No description

getSessionHost()

No description

getUserAgent()

No description

getReferrer()

No description

string
fetchServerValue(string $name)

Fetches a value from $_SERVER or $_ENV

string
fetchIp()

Fetches the IP address of the current visitor

string
fetchAltIp()

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

boolean
isBrowser(string $browser, float $version = 0)

Browser detection system - returns whether or not the visiting browser is the one specified

getCachePageForGuestTime()

No description

getUseEarlyFlush()

No description

getVbUrlScheme()

These are mostly only meaningful for web requests, but we need to keep a consistant interface for requests so provide a trivial default here.

getVbHttpHost()

No description

getVbUrlPath()

No description

getVbUrlQuery()

No description

getVbUrlQueryRaw()

No description

getVbUrlClean()

No description

getVbUrlWebroot()

No description

getVbUrlBasePath()

No description

getScriptPath()

No description

setLanguageid($languageid)

No description

getLanguageid()

No description

static 
setCookieSalt(string $salt)

Overrides the default cookie salt. Required for vB Cloud.

resolveRequestUrl()

No description

static string
stripSessionhash(string $string)

Strips out the s=gobbledygook& rubbish from URLs Extracted from vB_Input_Cleaner

string
addQuery(string $path, string $query = false)

Adds a query string to a path, fixing the query characters.

createSessionNew(string $sessionhash, array $restoreSessionInfo)

Creates a session object and attach it to the request. May reuse an existing session in the database.

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 15
__construct()

in vB_Request at line 150
string filter_ip($ip)

Validate the IP address (both ipv4 & ipv6)

Parameters

$ip

Return Value

string

in vB_Request at line 159
string getSessionClass()

Returns the name of session class associated to the request

Return Value

string

at line 22
createSession()

Creates a session based on client input

in vB_Request at line 188
protected setSession(vB_Session $session)

Handles setting adding a newly created session to the request object

Adds the session to the request Sets the session language to the request langauge if we have one Registers the session with the vB class

Parameters

vB_Session $session

in vB_Request at line 210
$session createSessionForUser($userid)

Creates a session for a specific user

Used to create session for a particular user based on the current request information. Useful for creating a session after the user logs in. This will overwrite the current Session in this request class and the vB current session.

Parameters

$userid integer The user to create the session for.

Return Value

$session vB_Session The session created. Not that this will be a subclass of the abstract vB_Session Class

in vB_Request at line 233
getTimeNow()

in vB_Request at line 238
getIpAddress()

in vB_Request at line 243
getAltIp()

in vB_Request at line 248
getSessionHost()

in vB_Request at line 253
getUserAgent()

in vB_Request at line 258
getReferrer()

in vB_Request at line 269
protected string fetchServerValue(string $name)

Fetches a value from $_SERVER or $_ENV

Parameters

string $name

Return Value

string

in vB_Request at line 289
protected string fetchIp()

Fetches the IP address of the current visitor

Return Value

string

in vB_Request at line 316
protected string fetchAltIp()

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

Return Value

string

in vB_Request at line 388
boolean isBrowser(string $browser, float $version = 0)

Browser detection system - returns whether or not the visiting browser is the one specified

Parameters

string $browser Browser name (opera, ie, mozilla, firebord, firefox... etc. - see $is array)
float $version Minimum acceptable version for true result (optional)

Return Value

boolean

in vB_Request at line 555
getCachePageForGuestTime()

in vB_Request at line 560
getUseEarlyFlush()

in vB_Request_Web at line 66
getVbUrlScheme()

These are mostly only meaningful for web requests, but we need to keep a consistant interface for requests so provide a trivial default here.

in vB_Request_Web at line 61
getVbHttpHost()

in vB_Request_Web at line 71
getVbUrlPath()

in vB_Request_Web at line 76
getVbUrlQuery()

in vB_Request_Web at line 81
getVbUrlQueryRaw()

in vB_Request_Web at line 86
getVbUrlClean()

in vB_Request_Web at line 91
getVbUrlWebroot()

in vB_Request_Web at line 96
getVbUrlBasePath()

in vB_Request_Web at line 101
getScriptPath()

in vB_Request at line 617
setLanguageid($languageid)

Parameters

$languageid

in vB_Request at line 622
getLanguageid()

in vB_Request_Web at line 56
static setCookieSalt(string $salt)

Overrides the default cookie salt. Required for vB Cloud.

Parameters

string $salt

in vB_Request_Web at line 113
protected resolveRequestUrl()

in vB_Request_Web at line 312
static string stripSessionhash(string $string)

Strips out the s=gobbledygook& rubbish from URLs Extracted from vB_Input_Cleaner

Parameters

string $string The URL string from which to remove the session stuff

Return Value

string

in vB_Request_Web at line 326
string addQuery(string $path, string $query = false)

Adds a query string to a path, fixing the query characters.

Parameters

string $path The path to add the query to
string $query The query string to add to the path

Return Value

string The resulting string

at line 52
createSessionNew(string $sessionhash, array $restoreSessionInfo)

Creates a session object and attach it to the request. May reuse an existing session in the database.

Parameters

string $sessionhash -- the token given to the client for session handling. If the client has this token they can use the session.
array $restoreSessionInfo -- Information to handle "remember me" logic. * remembermetoken -- Token value for "remember me". Stored in the "password" cookie for legacy reasons. There are so special values to indicate that we should reauthentic via a method other than the internal vB remember me system. * userid -- user we are remembering * fbsr_{appid} (optional) -- Only valid if facebook is enabled, and only used if "remembermetoken" is "facebook".

@return array
* sessionhash -- the session hash for the session created.  This may be different from the passed sessionhash if that
        session was expired or otherwise unusable.
* remembermetoken -- token for remembering the user.  This should only be set if the user requests it (or if the
        there is already a token present but the token changed).  It is possible for this to change and if it
        does and is not passed back to the client future attempts to "remember" the session (using the old value) will fail.