GLOBALS
in package
GLOBALS
Rather than using the PHP $GLOBALS array for common variables, we store, set and access them from here.
Table of Contents
Methods
- __construct() : mixed
- GLOBALS
- addTplVar() : mixed
- Add a data to a template variable
- buildTplVarString() : string
- Get a concatenated string of the data of a template variable (involve the are only strings)
- clearTplVar() : mixed
- Clear data stored of a template variable
- deleteUserVarsArray() : array<string|int, mixed>
- Empty user variable array – used in /office.php to clear any existing user variables ready for a read-only access from Word add-in etc.
- emptyTempStorage() : mixed
- Empty the tempStorage array.
- getBrowserTabID() : string
- Get browserTabID
- getDbQueries() : int
- Get the number of DB queries this script run
- getDbTimeElapsed() : float
- Get the time elapsed during DB queries
- getDirtyVars() : array<string|int, mixed>
- Get $dirtyVars
- getError() : string
- get error message
- getPageElapsedTime() : float
- Get elapsed time of the page
- getTempStorage() : mixed
- Get $tempStorage either in whole or in part
- getTempStorageArray() : array<string|int, mixed>
- Get $tempStorage array by prefix
- getTplVar() : array<string|int, mixed>
- Get the data of a template variable
- getTplVarKeys() : array<string|int, mixed>
- Get the list of all template variables name which have data stored
- getUserVar() : string
- Get a user variable
- getUserVarsArray() : array<string|int, mixed>
- Get user variable array
- getVars() : array<string|int, mixed>
- Get $vars
- incrementDbQueries() : mixed
- Increment the DB query counter
- incrementDbTimeElapsed() : mixed
- Increment the DB time elapsed
- initTempStorage() : mixed
- Initaliaze the tempStorage array is using the configuration variable browserTabID.
- nullifyBrowserTabID() : mixed
- Nullify browserTabID.
- setBrowserTabID() : mixed
- Set browserTabID
- setError() : mixed
- set error message
- setTempStorage() : mixed
- Set tempStorage variables
- setTempStorageArray() : mixed
- Set $tempStorage array by prefix
- setTplVar() : mixed
- Set the data of a template variable after clearing its current data
- setUserVar() : mixed
- Set a user variable
- setVars() : mixed
- Set $vars
- startPageTimer() : mixed
- Start the global page timer with the current UNIX timestamp
- stopPageTimer() : mixed
- Stop the global page timer with the current UNIX timestamp
- tplVarExists() : bool
- See if some data are defined for a template variable
- unsetTempStorage() : mixed
- Unset tempStorage variables
- unsetTempStorageArray() : mixed
- Unset $tempStorage array by prefix
Methods
__construct()
GLOBALS
public
__construct() : mixed
addTplVar()
Add a data to a template variable
public
static addTplVar(string $variableName, string $variableValue) : mixed
Parameters
- $variableName : string
- $variableValue : string
buildTplVarString()
Get a concatenated string of the data of a template variable (involve the are only strings)
public
static buildTplVarString(string $variableName[, string $glueString = '' ]) : string
Parameters
- $variableName : string
- $glueString : string = ''
Return values
stringclearTplVar()
Clear data stored of a template variable
public
static clearTplVar(string $variableName) : mixed
Parameters
- $variableName : string
deleteUserVarsArray()
Empty user variable array – used in /office.php to clear any existing user variables ready for a read-only access from Word add-in etc.
public
static deleteUserVarsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>emptyTempStorage()
Empty the tempStorage array.
public
static emptyTempStorage() : mixed
getBrowserTabID()
Get browserTabID
public
static getBrowserTabID() : string
Return values
string —GLOBALS::WIKINDX_BROWSER_TAB_ID
getDbQueries()
Get the number of DB queries this script run
public
static getDbQueries() : int
Return values
intgetDbTimeElapsed()
Get the time elapsed during DB queries
public
static getDbTimeElapsed() : float
Return values
floatgetDirtyVars()
Get $dirtyVars
public
static getDirtyVars() : array<string|int, mixed>
Return values
array<string|int, mixed>getError()
get error message
public
static getError() : string
Return values
string —GLOBALS::WIKINDX_ERROR
getPageElapsedTime()
Get elapsed time of the page
public
static getPageElapsedTime() : float
Return values
floatgetTempStorage()
Get $tempStorage either in whole or in part
public
static getTempStorage([string $key = false ]) : mixed
Parameters
- $key : string = false
-
default is FALSE
Return values
mixed —Array ($key == FALSE), NULL if $key not found, else string
getTempStorageArray()
Get $tempStorage array by prefix
public
static getTempStorageArray(string $prefix) : array<string|int, mixed>
Parameters
- $prefix : string
Return values
array<string|int, mixed>getTplVar()
Get the data of a template variable
public
static getTplVar(string $variableName) : array<string|int, mixed>
Parameters
- $variableName : string
Return values
array<string|int, mixed>getTplVarKeys()
Get the list of all template variables name which have data stored
public
static getTplVarKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserVar()
Get a user variable
public
static getUserVar(string $key[, mixed $default = false ]) : string
Parameters
- $key : string
- $default : mixed = false
-
Default return value if set value does not exist.
Return values
stringgetUserVarsArray()
Get user variable array
public
static getUserVarsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getVars()
Get $vars
public
static getVars() : array<string|int, mixed>
Return values
array<string|int, mixed>incrementDbQueries()
Increment the DB query counter
public
static incrementDbQueries() : mixed
incrementDbTimeElapsed()
Increment the DB time elapsed
public
static incrementDbTimeElapsed(float $appendTime) : mixed
Parameters
- $appendTime : float
initTempStorage()
Initaliaze the tempStorage array is using the configuration variable browserTabID.
public
static initTempStorage(object $db, string $uuid) : mixed
Storage is writen to the database table session_browser_tab when CLOSE.php is called (i.e., at the end of a session). Otherwise, during a session, $tempStorage is available in memory.
Parameters
- $db : object
- $uuid : string
nullifyBrowserTabID()
Nullify browserTabID.
public
static nullifyBrowserTabID() : mixed
A plugin, for example, can set the public var $BT = FALSE to disable browserTabID
setBrowserTabID()
Set browserTabID
public
static setBrowserTabID(string $browserTabID) : mixed
Parameters
- $browserTabID : string
setError()
set error message
public
static setError(string $error) : mixed
Parameters
- $error : string
setTempStorage()
Set tempStorage variables
public
static setTempStorage(array<string|int, mixed> $array) : mixed
Parameters
- $array : array<string|int, mixed>
-
(assoc. array)
setTempStorageArray()
Set $tempStorage array by prefix
public
static setTempStorageArray(array<string|int, mixed> $array, string $prefix) : mixed
Parameters
- $array : array<string|int, mixed>
- $prefix : string
setTplVar()
Set the data of a template variable after clearing its current data
public
static setTplVar(string $variableName, string $variableValue) : mixed
Parameters
- $variableName : string
- $variableValue : string
setUserVar()
Set a user variable
public
static setUserVar(string $key, mixed $value) : mixed
Parameters
- $key : string
- $value : mixed
setVars()
Set $vars
public
static setVars(array<string|int, mixed> $cleanInput, array<string|int, mixed> $dirtyInput) : mixed
$cleanInput has been stripped of HTML etc.
Parameters
- $cleanInput : array<string|int, mixed>
- $dirtyInput : array<string|int, mixed>
startPageTimer()
Start the global page timer with the current UNIX timestamp
public
static startPageTimer() : mixed
stopPageTimer()
Stop the global page timer with the current UNIX timestamp
public
static stopPageTimer() : mixed
tplVarExists()
See if some data are defined for a template variable
public
static tplVarExists(string $variableName) : bool
Parameters
- $variableName : string
Return values
boolunsetTempStorage()
Unset tempStorage variables
public
static unsetTempStorage(array<string|int, mixed> $array) : mixed
Parameters
- $array : array<string|int, mixed>
-
(keys to unset)
unsetTempStorageArray()
Unset $tempStorage array by prefix
public
static unsetTempStorageArray(string $prefix) : mixed
Parameters
- $prefix : string