The constructor of the Cache_Lite core class. You can give an associative array as an argument to set a lot of options.
associative array to set a lot of options
Table 23-1.
Option | Data Type | Default Value | Description |
---|---|---|---|
cacheDir | string | /tmp/ | directory where to put the cache file (with a trailing slash at the end) |
caching | boolean | TRUE | enable / disable caching |
lifeTime | integer | 3600 | cache lifetime in seconds |
fileLocking | boolean | TRUE | enable / disable fileLocking (can avoid cache corruption under bad circumstances) |
writeControl | boolean | TRUE | enable / disable write control (enable write control will lightly slow the cache writing but not the cache reading, write control can detect some corrupt cache files but maybe it's not a perfect control) |
readControl | boolean | TRUE | enable / disable read control (if enabled, a control key is embeded in cache file and this key is compared with the one calculated after the reading) |
readControlType | string | crc32 | Type of read control (only if read control is enabled). Must be 'md5' (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash control (lightly less safe but faster)) or 'strlen' (for a length only test (fastest)) |
pearErrorMode | integer | CACHE_LITE_ERROR_RETURN | pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for immediate stop of the script (good for debug)) |
fileNameProtection | boolean | TRUE | file Name protection (if set to true, you can use any cache id or group name, if set to false, it can be faster but cache ids and group names will be used directly in cache file names so be carefull with special characters...) |
automaticSerialization | boolean | FALSE | enable / disable automatic serialization (it can be used to save directly datas which aren't strings but it's slower) |
memoryCaching | boolean | FALSE | [BETA QUALITY] enable / disable "Memory Caching" (NB : there is no lifetime for memory caching, only the end of the script) |
onlyMemoryCaching | boolean | FALSE | [BETA QUALITY] enable / disable "Only Memory Caching" (if enabled, files are not used anymore) |
memoryCachingLimit | integer | 1000 | [BETA QUALITY] max number of records to store into memory caching |
Example 23-1. Using most common options
|