class vB_Request_Web extends vB_Request

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
protected $vBUrlScheme
protected $vBUrlPath
protected $vBUrlQuery
protected $vBUrlQueryRaw
protected $vBUrlClean
protected $vBUrlWebroot
protected $vBUrlBasePath
protected $vBHttpHost
protected $scriptPath

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.

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 37
__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

in vB_Request at line 167
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()

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.

at line 61
getVbHttpHost()

at line 71
getVbUrlPath()

at line 76
getVbUrlQuery()

at line 81
getVbUrlQueryRaw()

at line 86
getVbUrlClean()

at line 91
getVbUrlWebroot()

at line 96
getVbUrlBasePath()

at line 101
getScriptPath()

in vB_Request at line 617
setLanguageid($languageid)

Parameters

$languageid

in vB_Request at line 622
getLanguageid()

at line 56
static setCookieSalt(string $salt)

Overrides the default cookie salt. Required for vB Cloud.

Parameters

string $salt

at line 113
protected resolveRequestUrl()

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

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