CSPreloader
in package
This class provides the possibility to activate a global cache without any dependencies to INI or SECURITY settings.
It caches following areas:
- Parsing & Loading of INI files
- Parsing & Loading of security XML files
- Includes the existing plugin cache handling
- Preloads the public certificate
- Stores the available module init files
Tags
Table of Contents
- TYPE_CERTS = 5
- TYPE_INI_VALUES = 3
- TYPE_LICENSE = 4
- TYPE_MODULE_INIT_FILES = 6
- TYPE_OPTION_MATCHING_PLUGINS = 7
- TYPE_SECURITY_INI_FILES = 1
- TYPE_SECURITY_XML = 2
- getData() : mixed
- Returns the cached data for a specific type and key.
- hasData() : bool
- Checks if the cache data exists for the given type and key.
- init() : void
- Initializes the CSPreloader and loads the cache if activated.
- isEnabled() : bool
- Checks if the preloader is enabled.
- registerFile() : void
- Register a given file path to check for modifications and invalidate the cache in this case.
- reset() : bool
- Invalidates the cache.
- setData() : void
- Sets the cached data for a specific type and key.
Constants
TYPE_CERTS
public
mixed
TYPE_CERTS
= 5
Tags
TYPE_INI_VALUES
public
mixed
TYPE_INI_VALUES
= 3
Tags
TYPE_LICENSE
public
mixed
TYPE_LICENSE
= 4
Tags
TYPE_MODULE_INIT_FILES
public
mixed
TYPE_MODULE_INIT_FILES
= 6
Tags
TYPE_OPTION_MATCHING_PLUGINS
public
mixed
TYPE_OPTION_MATCHING_PLUGINS
= 7
Tags
TYPE_SECURITY_INI_FILES
public
mixed
TYPE_SECURITY_INI_FILES
= 1
Tags
TYPE_SECURITY_XML
public
mixed
TYPE_SECURITY_XML
= 2
Tags
Methods
getData()
Returns the cached data for a specific type and key.
public
static getData(int $iType, string $sKey) : mixed
Parameters
- $iType : int
-
The preload type.
- $sKey : string
-
The key of the cache value.
Tags
Return values
mixed —hasData()
Checks if the cache data exists for the given type and key.
public
static hasData(int $iType, string $sKey) : bool
Parameters
- $iType : int
-
The preload type.
- $sKey : string
-
The key of the cache value.
Tags
Return values
bool —init()
Initializes the CSPreloader and loads the cache if activated.
public
static init() : void
Tags
Return values
void —isEnabled()
Checks if the preloader is enabled.
public
static isEnabled() : bool
Tags
Return values
bool —registerFile()
Register a given file path to check for modifications and invalidate the cache in this case.
public
static registerFile(string $sFilePath) : void
Parameters
- $sFilePath : string
-
The file path, which should be checked for modifications.
Tags
Return values
void —reset()
Invalidates the cache.
public
static reset() : bool
Tags
Return values
bool —setData()
Sets the cached data for a specific type and key.
public
static setData(int $iType, string $sKey, mixed $mData) : void
Parameters
- $iType : int
-
The preload type.
- $sKey : string
-
The key of the cache value.
- $mData : mixed
-
The cached data, which should be stored.
