vB_Request_WebApi
extends vB_Request_Web
in package
Table of Contents
- COOKIE_SALT = "xgRHfOahqqzb0xgzNtdEjIJua7wVh6bEd"
- $COOKIE_SALT : mixed
- $altIp : mixed
- $ipAddress : mixed
- $languageid : mixed
- $referrer : mixed
- $scriptPath : mixed
- $session : vB_Session
- $sessionClass : string
- $timeNow : int
- UNIX timestamp at the creation of request
- $userAgent : mixed
- $vBHttpHost : mixed
- $vBUrlBasePath : mixed
- $vBUrlClean : mixed
- $vBUrlPath : mixed
- $vBUrlQuery : mixed
- $vBUrlQueryRaw : mixed
- $vBUrlScheme : mixed
- $vBUrlWebroot : mixed
- __construct() : mixed
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- addQuery() : string
- Adds a query string to a path, fixing the query characters.
- createSession() : mixed
- createSessionForUser() : mixed
- Creates a session for a specific user
- createSessionNew() : mixed
- Creates a session object and attach it to the request. May reuse an existing session in the database.
- getAltIp() : mixed
- getCachePageForGuestTime() : mixed
- getIpAddress() : mixed
- getLanguageid() : mixed
- getReferrer() : mixed
- getScriptPath() : mixed
- getSessionClass() : string
- Returns the name of session class associated to the request
- getSessionHost() : mixed
- getTimeNow() : mixed
- getUseEarlyFlush() : mixed
- getUserAgent() : mixed
- getVbHttpHost() : mixed
- getVbUrlBasePath() : mixed
- getVbUrlClean() : mixed
- getVbUrlPath() : mixed
- getVbUrlQuery() : mixed
- getVbUrlQueryRaw() : mixed
- getVbUrlScheme() : mixed
- These are mostly only meaningful for web requests, but we need to keep a consistant interface for requests so provide a trivial default here.
- getVbUrlWebroot() : mixed
- isBrowser() : bool
- Browser detection system - returns whether or not the visiting browser is the one specified
- setCookieSalt() : mixed
- Overrides the default cookie salt. Required for vB Cloud.
- setLanguageid() : mixed
- stripSessionhash() : string
- Strips out the s=gobbledygook& rubbish from URLs Extracted from vB_Input_Cleaner
- fetchAltIp() : string
- Fetches an alternate IP address of the current visitor, attempting to detect proxies etc.
- fetchIp() : string
- Fetches the IP address of the current visitor
- fetchServerValue() : string
- Fetches a value from $_SERVER or $_ENV
- resolveRequestUrl() : mixed
- Resolves information about the request URL.
- setSession() : mixed
- Handles setting adding a newly created session to the request object
Constants
COOKIE_SALT
public
mixed
COOKIE_SALT
= "xgRHfOahqqzb0xgzNtdEjIJua7wVh6bEd"
Properties
$COOKIE_SALT
public
static mixed
$COOKIE_SALT
= "xgRHfOahqqzb0xgzNtdEjIJua7wVh6bEd"
$altIp
protected
mixed
$altIp
$ipAddress
protected
mixed
$ipAddress
$languageid
protected
mixed
$languageid
= 0
$referrer
protected
mixed
$referrer
$scriptPath
protected
mixed
$scriptPath
$session
protected
vB_Session
$session
= NULL
$sessionClass
protected
string
$sessionClass
$timeNow
UNIX timestamp at the creation of request
protected
int
$timeNow
$userAgent
protected
mixed
$userAgent
$vBHttpHost
protected
mixed
$vBHttpHost
$vBUrlBasePath
protected
mixed
$vBUrlBasePath
$vBUrlClean
protected
mixed
$vBUrlClean
$vBUrlPath
protected
mixed
$vBUrlPath
$vBUrlQuery
protected
mixed
$vBUrlQuery
$vBUrlQueryRaw
protected
mixed
$vBUrlQueryRaw
$vBUrlScheme
protected
mixed
$vBUrlScheme
= 'http'
$vBUrlWebroot
protected
mixed
$vBUrlWebroot
Methods
__construct()
public
__construct() : mixed
Return values
mixed —__serialize()
public
__serialize() : mixed
Return values
mixed —__sleep()
public
__sleep() : mixed
Return values
mixed —__unserialize()
public
__unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —addQuery()
Adds a query string to a path, fixing the query characters.
public
addQuery(mixed $path[, mixed $query = false ]) : string
Parameters
- $path : mixed
- $query : mixed = false
Return values
string —The resulting string
createSession()
public
createSession() : mixed
Return values
mixed —createSessionForUser()
Creates a session for a specific user
public
createSessionForUser( $userid) : mixed
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
Return values
mixed —createSessionNew()
Creates a session object and attach it to the request. May reuse an existing session in the database.
public
createSessionNew(string $sessionhash, array<string|int, mixed> $restoreSessionInfo) : mixed
Parameters
- $sessionhash : string
-
-- the token given to the client for session handling. If the client has this token they can use the session.
- $restoreSessionInfo : array<string|int, mixed>
-
-- 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.
Return values
mixed —getAltIp()
public
getAltIp() : mixed
Return values
mixed —getCachePageForGuestTime()
public
getCachePageForGuestTime() : mixed
Return values
mixed —getIpAddress()
public
getIpAddress() : mixed
Return values
mixed —getLanguageid()
public
getLanguageid() : mixed
Return values
mixed —getReferrer()
public
getReferrer() : mixed
Return values
mixed —getScriptPath()
public
getScriptPath() : mixed
Return values
mixed —getSessionClass()
Returns the name of session class associated to the request
public
getSessionClass() : string
Return values
string —getSessionHost()
public
getSessionHost() : mixed
Return values
mixed —getTimeNow()
public
getTimeNow() : mixed
Return values
mixed —getUseEarlyFlush()
public
getUseEarlyFlush() : mixed
Return values
mixed —getUserAgent()
public
getUserAgent() : mixed
Return values
mixed —getVbHttpHost()
public
getVbHttpHost() : mixed
Return values
mixed —getVbUrlBasePath()
public
getVbUrlBasePath() : mixed
Return values
mixed —getVbUrlClean()
public
getVbUrlClean() : mixed
Return values
mixed —getVbUrlPath()
public
getVbUrlPath() : mixed
Return values
mixed —getVbUrlQuery()
public
getVbUrlQuery() : mixed
Return values
mixed —getVbUrlQueryRaw()
public
getVbUrlQueryRaw() : mixed
Return values
mixed —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.
public
getVbUrlScheme() : mixed
Return values
mixed —getVbUrlWebroot()
public
getVbUrlWebroot() : mixed
Return values
mixed —isBrowser()
Browser detection system - returns whether or not the visiting browser is the one specified
public
isBrowser(mixed $browser, mixed $version) : bool
Parameters
- $browser : mixed
- $version : mixed
Return values
bool —setCookieSalt()
Overrides the default cookie salt. Required for vB Cloud.
public
static setCookieSalt(string $salt) : mixed
Parameters
- $salt : string
Return values
mixed —setLanguageid()
public
setLanguageid(mixed $languageid) : mixed
Parameters
- $languageid : mixed
Return values
mixed —stripSessionhash()
Strips out the s=gobbledygook& rubbish from URLs Extracted from vB_Input_Cleaner
public
static stripSessionhash(mixed $string) : string
Parameters
- $string : mixed
Return values
string —fetchAltIp()
Fetches an alternate IP address of the current visitor, attempting to detect proxies etc.
protected
fetchAltIp() : string
Return values
string —fetchIp()
Fetches the IP address of the current visitor
protected
fetchIp() : string
Return values
string —fetchServerValue()
Fetches a value from $_SERVER or $_ENV
protected
fetchServerValue(string $name) : string
Parameters
- $name : string
Return values
string —resolveRequestUrl()
Resolves information about the request URL.
protected
resolveRequestUrl() : mixed
Extracted from class vB_Input_Cleaner
Return values
mixed —setSession()
Handles setting adding a newly created session to the request object
protected
setSession(vB_Session $session) : mixed
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
- $session : vB_Session