addLazyLoader()
arrayFilterKeys()
autoload()
beginApplication()
canWriteDevelopmentFiles()
debugMode()
disablePhpErrorHandler()
enablePhpErrorHandler()
generateRandomString()
get()
getCache()
getConfig()
getConfigDir()
getDb()
getOptions()
getRequestPaths()
getRootDir()
getSession()
getSimpleCacheData()
getWithFallback()
gzipContentIfSupported()
handleException()
handlePhpError()
initialize()
lazyLoad()
loadCache()
loadConfig()
loadDb()
loadDefaultConfig()
loadDefaultData()
loadOptions()
loadRequestPaths()
loadSimpleCache()
mapMerge()
parseQueryString()
removeLazyLoader()
resolveDynamicClass()
setDebugMode()
setDefaultsFromOptions()
setMemoryLimit()
setSimpleCacheData()
undoMagicQuotes()
$externalDataPath
$externalDataUrl
$host
$integerSentinel
$jQueryVersion
$javaScriptUrl
$jsVersion
$secure
$time
$version
$versionId
$_classCache
$_configDir
$_debug
$_handlePhpError
$_initialized
$_lazyLoaders
$_memoryLimit
$_randomData
$_rootDir
URL_ID_DELIMITER
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.
string
Index to assign lazy loader to
callback
Callback 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.
string
Class to load
boolean
beginApplication(string $configDir, string $rootDir, boolean $loadDefaultData)
This causes the environment to be setup as necessary.
string
Path to application configuration directory. See {@link $_configDir}.
string
Path to application root directory. See {@link $_rootDir}.
boolean
True to load default data (config, DB, etc)
canWriteDevelopmentFiles() : boolean
boolean
debugMode() : boolean
boolean
disablePhpErrorHandler()
enablePhpErrorHandler()
generateRandomString(integer $length) : string
integer
string
get(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. |
---|
mixed
getCache() : \Zend_Cache_Core | boolean
\Zend_Cache_Core
boolean
getConfig() : \Zend_Config
\Zend_Config
getConfigDir() : string
string
getDb() : \Zend_Db_Adapter_Abstract
\Zend_Db_Adapter_Abstract
getRequestPaths(\Zend_Controller_Request_Http $request) : array
\Zend_Controller_Request_Http
array
Keys: basePath, host, protocol, fullBasePath, requestUrigetRootDir() : string
string
getSimpleCacheData(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
mixed
false
False 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.
string
Index to look for
callback
Callback function to call if not found
array
Arguments to pass to callback
mixed
gzipContentIfSupported(string $content) : array
string
Content to gzip; this will be modified if necessary
array
List of HTTP headers to addhandlePhpError(integer $errorType, string $errorString, string $file, integer $line)
integer
Type of error (one of the E_* constants)
string
string
integer
initialize(string $configDir, string $rootDir, boolean $loadDefaultData)
string
Path to application configuration directory. See {@link $_configDir}.
string
Path to application root directory. See {@link $_rootDir}.
boolean
True 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.
string
Index to lazy load
mixed
By ref; data returned by lazy loader
boolean
True if a lazy loader was calledloadCache(\Zend_Config $cacheConfig) : \Zend_Cache_Core | \Zend_Cache_Frontend | false
\Zend_Configuration
Configuration to use
\Zend_Cache_Core
\Zend_Cache_Frontend
false
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_Config
loadDb(\Zend_Config $dbConfig) : \Zend_Db_Adapter_Abstract
\Zend_Configuration
Configuration to use
\Zend_Db_Adapter_Abstract
loadDefaultConfig() : \Zend_Config
User-specified versions will override this.
\Zend_Config
loadDefaultData()
loadOptions() : \XenForo_Options
loadRequestPaths() : array
array
loadSimpleCache() : array
array
mapMerge(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
array
parseQueryString(string $string) : array
string
array
removeLazyLoader(string $index) : boolean
string
Index to remove from
boolean
resolveDynamicClass(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.
string
Name of class
string
Type of class (for determining event to fire)
string
false
If the specified class doesn't exist, an alternative base can be specified
false
string
False or name of class to instantiatesetDebugMode(boolean $debug)
boolean
setDefaultsFromOptions(\XenForo_Options $options)
\XenForo_Options
setMemoryLimit(integer $limit)
Will not shrink the limit.
integer
Limit 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
mixed
If false, the specified cache key is removed
undoMagicQuotes(array $array, integer $depth)
array
The array to have slashes stripped, this is passed by reference
integer
Recursion 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