Base XenForo application class.
Sets up the environment as necessary and acts as the registry for the application. Can broker to the autoload as well.
| package | XenForo_Core |
|---|
addLazyLoader(string $index, callback $callback)
This lazy loader callback will be called if the specified index is not in the registry.
The 3rd argument and on will be passed to the lazy loader callback.
stringIndex to assign lazy loader to
callbackCallback to call when triggered
arrayFilterKeys(array $data, array $keys) : array
Example: arrayFilterKeys(array('a' => 1, 'b' => 2, 'c' => 3), array('b', 'c')) Returns: array('b' => 2, 'c' => 3)
array
array
array$dataautoload(string $class) : boolean
Could simply call the autoloader directly but this method is recommended to reduce dependencies.
stringClass to load
booleanbeginApplication(string $configDir, string $rootDir, boolean $loadDefaultData)
This causes the environment to be setup as necessary.
stringPath to application configuration directory. See {@link $_configDir}.
stringPath to application root directory. See {@link $_rootDir}.
booleanTrue to load default data (config, DB, etc)
canWriteDevelopmentFiles() : boolean
booleandebugMode() : boolean
booleandisablePhpErrorHandler()
enablePhpErrorHandler()
generateRandomString(integer $length) : string
integer
stringget(string $index) : mixed
This method can be called from an object of type Zend_Registry, or it can be called statically. In the latter case, it uses the default static instance stored in the class.
string\Zend_Exception |
if no entry is registerd for $index. |
|---|
mixedgetCache() : \Zend_Cache_Core | boolean
\Zend_Cache_Coreboolean
getConfig() : \Zend_Config
\Zend_ConfiggetConfigDir() : string
stringgetDb() : \Zend_Db_Adapter_Abstract
\Zend_Db_Adapter_AbstractgetRequestPaths(\Zend_Controller_Request_Http $request) : array
\Zend_Controller_Request_Http
arrayKeys: basePath, host, protocol, fullBasePath, requestUrigetRootDir() : string
stringgetSimpleCacheData(string $key) : mixed | false
The simple cache is for data that you want available on on pages, but don't need to special rebuild behaviors for.
string
mixedfalseFalse if not in the cachegetWithFallback(string $index, callback $callback, array $args) : mixed
If it cannot be found, the callback is called and the result from the callback is set into the registry for that index.
stringIndex to look for
callbackCallback function to call if not found
arrayArguments to pass to callback
mixedgzipContentIfSupported(string $content) : array
stringContent to gzip; this will be modified if necessary
arrayList of HTTP headers to addhandlePhpError(integer $errorType, string $errorString, string $file, integer $line)
integerType of error (one of the E_* constants)
string
string
integer
initialize(string $configDir, string $rootDir, boolean $loadDefaultData)
stringPath to application configuration directory. See {@link $_configDir}.
stringPath to application root directory. See {@link $_rootDir}.
booleanTrue to load default data (config, DB, etc)
lazyLoad(string $index, mixed $return) : boolean
The loaded data is returned via a reference parameter, not the return value of the method. The return value is true only if the lazy loader was executed.
Once called, the data is set to the registry and the lazy loader is removed.
stringIndex to lazy load
mixedBy ref; data returned by lazy loader
booleanTrue if a lazy loader was calledloadCache(\Zend_Config $cacheConfig) : \Zend_Cache_Core | \Zend_Cache_Frontend | false
\Zend_ConfigurationConfiguration to use
\Zend_Cache_Core\Zend_Cache_Frontendfalse
loadConfig() : \Zend_Config
Mixes in over top of the default values. Provided a default is specified in loadDefaultConfig, all elements available to the config will always be defined. Non-default elements may still be defined in the loaded configuration.
\Zend_ConfigloadDb(\Zend_Config $dbConfig) : \Zend_Db_Adapter_Abstract
\Zend_ConfigurationConfiguration to use
\Zend_Db_Adapter_AbstractloadDefaultConfig() : \Zend_Config
User-specified versions will override this.
\Zend_ConfigloadDefaultData()
loadOptions() : \XenForo_Options
loadRequestPaths() : array
arrayloadSimpleCache() : array
arraymapMerge(array $first, array $second) : array
It is designed to recursively merge associative arrays (maps). If each array shares a key, that key is recursed and the child keys are merged.
This function does not handle merging of non-associative arrays (numeric keys) as a special case.
More than 2 arguments may be passed if desired.
array
array
arrayparseQueryString(string $string) : array
string
arrayremoveLazyLoader(string $index) : boolean
stringIndex to remove from
booleanresolveDynamicClass(string $class, string $type, string | false $fakeBase) : false | string
The classes to be loaded for this base class are grabbed via the event. These classes must inherit from from XFCP_x, which is a non-existant class that is dynamically created, inheriting from the correct class as needed.
If a fake base is needed when the base class doesn't exist, and there are no classes extending it, false will still be returned! This prevents an unnecessary eval.
stringName of class
stringType of class (for determining event to fire)
stringfalseIf the specified class doesn't exist, an alternative base can be specified
falsestringFalse or name of class to instantiatesetDebugMode(boolean $debug)
boolean
setDefaultsFromOptions(\XenForo_Options $options)
\XenForo_Options
setMemoryLimit(integer $limit)
Will not shrink the limit.
integerLimit must be given in integer (byte) format.
setSimpleCacheData(string $key, mixed $value)
This data will be persisted over pages indefinitely. Values of false will remove the cache data.
string
mixedIf false, the specified cache key is removed
undoMagicQuotes(array $array, integer $depth)
arrayThe array to have slashes stripped, this is passed by reference
integerRecursion depth to prevent malicious use
$externalDataPath : string
Must be web accessible and server-writable. Examples 'data', 'foo/bar/data', '../path/to/thingy'.
$externalDataUrl : string
Can be relative or absolute, but must point to the web-accessible location referred-to by $externalDataPath.
$host : string
$integerSentinel : string
$jQueryVersion : string
See XenForo_Dependencies_Public::getJquerySource()
$javaScriptUrl : string
Can be absolute or relative.
$jsVersion : string
$secure : boolean
$time : integer
This should be used whenever 'now' needs to be referred to.
$version : string: integer
These are used for visual output and installation/upgrading.
$versionId
$_classCache : array
$_configDir : string
$_debug : boolean
$_handlePhpError : boolean
Otherwise, they will be deferred to any previously registered handler (probably PHP's).
$_initialized : boolean
$_lazyLoaders : array
When a lazy loader is called, it is removed from the list. Key is the index and value is an array: 0 => callback 1 => array of arguments
$_memoryLimit
$_randomData : string
String of hex characters.
$_rootDir : string
Specific directories will be looked for within this.
URL_ID_DELIMITER