vB
in package
The vB core class.
Everything required at the core level should be accessible through this.
The core class performs initialisation for error handling, exception handling, application instantiation and optionally debug handling.
Table of Contents
Methods
- autoloadPreregister() : mixed
- Allows autoloaders to be registered before the vb autoloader.
- get_registry() : vB_Registry
- This is a temporary getter for retrieving the vbulletin object while we still needed TODO: remove this method
- getAutoloadInfo() : array<string|int, mixed>
- Returns debug autoload info
- getCleaner() : vB_Cleaner
- getConfig() : array<string|int, mixed>
- Returns a by-reference the config object
- getConfigFile() : mixed
- getCurrentSession() : vB_Session
- getDatastore() : vB_Datastore
- Returns a by-reference the config object
- getDbAssertor() : vB_dB_Assertor
- Returns a by-reference the assertor object
- getEventQueue() : mixed
- getHashchecker() : mixed
- getHooks() : mixed
- getLibraryFile() : string
- Get the fully qualified path for a file in the libraries directory taking into account phar status
- getLoggedWarnings() : mixed
- getProducts() : mixed
- getRequest() : vB_Request
- getString() : vB_Utility_String
- Get the string utility class
- getUndoLog() : vB_Undo_Log
- getUrlLoader() : vB_Utility_Url
- Get the utility url loader
- getUserContext() : vB_UserContext
- Returns a by-reference the usercontext object specified by $userId If no userId is specified, it uses the current session user
- getVbClassName() : mixed
- getVbClassNameFromTag() : mixed
- Utility function to get the class for an extendable class.
- getWordList() : vB_Utility_Wordlist
- Helper function to create a wordlist object directly from option text.
- includeLibraryFile() : void
- Include a file in the libraries directory taking into account phar status
- init() : mixed
- Initializes the vB framework.
- isDebug() : mixed
- isInstaller() : mixed
- isUserContextSet() : bool
- Checks if usercontext is set
- normalWarnings() : mixed
- reset() : mixed
- Intended for unit tests, this resets the portion of the test needed for testing to avoid cross contamination
- resetOtherUserContexts() : mixed
- Mainly intended for unit tests, this clears out the "additional" userContexts that are cached which may hold stale cached channel & other data
- sensitiveConfigOverride() : mixed
- setConfigFile() : mixed
- setCurrentSession() : mixed
- Sets the session as part of initializing the vB system
- setRequest() : mixed
- silentWarnings() : mixed
- skipShutdown() : mixed
- Notify the vB object not to do the normal shutdown
Methods
autoloadPreregister()
Allows autoloaders to be registered before the vb autoloader.
public
static autoloadPreregister(mixed $add_callback) : mixed
Parameters
- $add_callback : mixed
get_registry()
This is a temporary getter for retrieving the vbulletin object while we still needed TODO: remove this method
public
static & get_registry([mixed $skipDatastoreOptions = false ]) : vB_Registry
Parameters
- $skipDatastoreOptions : mixed = false
Tags
Return values
vB_RegistrygetAutoloadInfo()
Returns debug autoload info
public
static getAutoloadInfo() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of debug info containing 'classes' and 'count'
getCleaner()
public
static & getCleaner() : vB_Cleaner
Return values
vB_CleanergetConfig()
Returns a by-reference the config object
public
static & getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getConfigFile()
public
static getConfigFile() : mixed
getCurrentSession()
public
static & getCurrentSession() : vB_Session
Return values
vB_SessiongetDatastore()
Returns a by-reference the config object
public
static & getDatastore() : vB_Datastore
Return values
vB_DatastoregetDbAssertor()
Returns a by-reference the assertor object
public
static & getDbAssertor() : vB_dB_Assertor
Return values
vB_dB_AssertorgetEventQueue()
public
static getEventQueue() : mixed
getHashchecker()
public
static getHashchecker() : mixed
getHooks()
public
static getHooks() : mixed
getLibraryFile()
Get the fully qualified path for a file in the libraries directory taking into account phar status
public
static getLibraryFile(string $file) : string
Parameters
- $file : string
-
-- filename relative to the libraries directory
Return values
stringgetLoggedWarnings()
public
static getLoggedWarnings() : mixed
getProducts()
public
static getProducts() : mixed
getRequest()
public
static & getRequest() : vB_Request
Return values
vB_RequestgetString()
Get the string utility class
public
static getString() : vB_Utility_String
Return values
vB_Utility_StringgetUndoLog()
public
static getUndoLog() : vB_Undo_Log
Return values
vB_Undo_LoggetUrlLoader()
Get the utility url loader
public
static getUrlLoader([bool $forceAllowLocal = false ]) : vB_Utility_Url
Parameters
- $forceAllowLocal : bool = false
-
-- this will allways allow connections to local IP addresses regardless of the config setting. This is intended for integration with services with a known url that might reside locally (for instant an OAUTH server). It should never be used in a context where the url comes from user data.
Return values
vB_Utility_UrlgetUserContext()
Returns a by-reference the usercontext object specified by $userId If no userId is specified, it uses the current session user
public
static & getUserContext([mixed $userId = null ]) : vB_UserContext
Parameters
- $userId : mixed = null
Return values
vB_UserContextgetVbClassName()
public
static getVbClassName(mixed $package, mixed $name, mixed $base, mixed $interface[, mixed $checkexists = true ]) : mixed
Parameters
- $package : mixed
- $name : mixed
- $base : mixed
- $interface : mixed
- $checkexists : mixed = true
getVbClassNameFromTag()
Utility function to get the class for an extendable class.
public
static getVbClassNameFromTag(string $tag, string $base, string $interface[, bool $checkexists = true ]) : mixed
This is a simpe cover functoin that creates the classname from a tag value. Avoids requiring seperate storage of the package and name in config files or the database (or requiring individual callers to manage the translation).
This
Parameters
- $tag : string
-
-- the individual tag for the class. If it only contains a single string then it will be treated as a vB core class (this usage is deprecated). If it's of the form "prefix:name" we'll treat it as a class in package prefix. The value for name will have the first character uppercased so vB_Some_Class_Foo can be specified as "foo" (with the proper base)
- $base : string
-
-- the base part of the string without the front or the end so "Some_Class" for a class that should look like vB_Some_Class_Foo.
- $interface : string
-
. This can be an actual interface or a base class, but The class must be an instance of this class/interface to be valid. This is a security validation check to help avoid running classes based on potentially passed in data that may not be what they seem. Generally this will be vB_Some_Class when the base is 'Some_Class'.
- $checkexists : bool = true
-
-- Check that that class exists. In some cases the caller may wish to fall back to a generic solution if it doesn't or provide for custom db handling.
getWordList()
Helper function to create a wordlist object directly from option text.
public
static getWordList(string $optioname) : vB_Utility_Wordlist
This is the most common way we create word lists.
Parameters
- $optioname : string
Return values
vB_Utility_WordlistincludeLibraryFile()
Include a file in the libraries directory taking into account phar status
public
static includeLibraryFile(string $file) : void
Parameters
- $file : string
-
-- filename relative to the libraries directory
init()
Initializes the vB framework.
public
static init([mixed $relative_path = false ]) : mixed
All framework level objects and services are created so that they are available throughout the application. This is only done once even if the function is called multiple times.
Parameters
- $relative_path : mixed = false
isDebug()
public
static isDebug() : mixed
isInstaller()
public
static isInstaller() : mixed
isUserContextSet()
Checks if usercontext is set
public
static isUserContextSet([mixed $userId = null ]) : bool
Parameters
- $userId : mixed = null
Return values
boolnormalWarnings()
public
static normalWarnings() : mixed
reset()
Intended for unit tests, this resets the portion of the test needed for testing to avoid cross contamination
public
static reset() : mixed
resetOtherUserContexts()
Mainly intended for unit tests, this clears out the "additional" userContexts that are cached which may hold stale cached channel & other data
public
static resetOtherUserContexts([mixed $userId = NULL ]) : mixed
Parameters
- $userId : mixed = NULL
sensitiveConfigOverride()
public
static sensitiveConfigOverride(mixed $override) : mixed
Parameters
- $override : mixed
setConfigFile()
public
static setConfigFile(mixed $config_file) : mixed
Parameters
- $config_file : mixed
setCurrentSession()
Sets the session as part of initializing the vB system
public
static setCurrentSession([vB_Session $session = null ]) : mixed
Parameters
- $session : vB_Session = null
setRequest()
public
static setRequest(vB_Request $request) : mixed
Parameters
- $request : vB_Request
silentWarnings()
public
static silentWarnings() : mixed
skipShutdown()
Notify the vB object not to do the normal shutdown
public
static skipShutdown([mixed $skip = true ]) : mixed
Parameters
- $skip : mixed = true