JCacheStorageFile
Extends \JCacheStorageFile cache storage handler
package |
Joomla.Platform |
---|---|
subpackage |
Cache |
since |
11.1 |
Methods
__construct
Constructor
__construct(array $options = array())
since |
11.1 |
---|
Arguments
- $options
array
Optional parameters
_checkExpire
Check to make sure cache is still valid, if not, delete it.
_checkExpire(string $id, string $group) : boolean
since |
11.1 |
---|
Arguments
- $id
string
Cache key to expire.- $group
string
The cache data group.
Response
boolean
False if not valid
_cleanPath
Function to strip additional / or \ in a path name
_cleanPath(string $path, string $ds = DIRECTORY_SEPARATOR) : string
since |
11.1 |
---|
Arguments
- $path
string
The path to clean- $ds
string
Directory separator (optional)
Response
string
The cleaned path
_deleteFolder
Quickly delete a folder of files
_deleteFolder(string $path) : boolean
since |
11.1 |
---|
Arguments
- $path
string
The path to the folder to delete.
Response
boolean
True on success.
_filesInFolder
Utility function to quickly read the files in a folder.
_filesInFolder(string $path, string $filter = '.', mixed $recurse = false, boolean $fullpath = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\..*', '.*~')) : array
since |
11.1 |
---|
Arguments
- $path
string
The path of the folder to read.- $filter
string
A filter for file names.- $recurse
mixed
True to recursively search into sub-folders, or an integer to specify the maximum depth.- $fullpath
boolean
True to return the full path to the file.- $exclude
array
Array with names of files which should not be shown in the result.- $excludefilter
array
Array of folder names to exclude
Response
array
Files in the given folder.
_folders
Utility function to read the folders in a folder.
_folders(string $path, string $filter = '.', mixed $recurse = false, boolean $fullpath = false, array $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array $excludefilter = array('^\..*')) : array
since |
11.1 |
---|
Arguments
- $path
string
The path of the folder to read.- $filter
string
A filter for folder names.- $recurse
mixed
True to recursively search into sub-folders, or an integer to specify the maximum depth.- $fullpath
boolean
True to return the full path to the folders.- $exclude
array
Array with names of folders which should not be shown in the result.- $excludefilter
array
Array with regular expressions matching folders which should not be shown in the result.
Response
array
Folders in the given folder.
_getCacheId
Get a cache_id string from an id/group pair
_getCacheId(string $id, string $group) : string
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group
Response
string
The cache_id string
_getFilePath
Get a cache file path from an id/group pair
_getFilePath(string $id, string $group) : string
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group
Response
string
The cache file path
addIncludePath
Add a directory where JCacheStorage should search for handlers. You may either pass a string or an array of directories.
addIncludePath(string $path = '') : array
since |
11.1 |
---|
Arguments
- $path
string
A path to search.
Response
array
An array with directory elements
clean
Clean cache for a group given a mode.
clean(string $group, string $mode = null) : boolean
since |
11.1 |
---|
Arguments
- $group
string
The cache data group- $mode
string
The mode for cleaning cache [group|notgroup] group mode : cleans all cache in the group notgroup mode : cleans all cache not in the group
Response
boolean
True on success, false otherwise
gc
Garbage collect expired cache data
gc() : boolean
since |
11.1 |
---|
Response
boolean
True on success, false otherwise.
get
Get cached data by id and group
get(string $id, string $group, boolean $checkTime = true) : mixed
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group- $checkTime
boolean
True to verify cache time expiration threshold
Response
mixed
Boolean false on failure or a cached data object
getAll
Get all cached data
getAll() : mixed
since |
11.1 |
---|
Response
mixed
Boolean false on failure or a cached data object
getInstance
Returns a cache storage handler object, only creating it if it doesn't already exist.
getInstance(string $handler = null, array $options = array()) : \JCacheStorageHandler
since |
11.1 |
---|
Arguments
- $handler
string
The cache storage handler to instantiate- $options
array
Array of handler options
Response
\JCacheStorageHandler
A JCacheStorageHandler object
lock
Lock cached item
lock(string $id, string $group, integer $locktime) : boolean
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group- $locktime
integer
Cached item max lock time
Response
boolean
True on success, false otherwise.
remove
Remove a cached data entry by id and group
remove(string $id, string $group) : boolean
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group
Response
boolean
True on success, false otherwise
store
Store the data to cache by id and group
store(string $id, string $group, string $data) : boolean
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group- $data
string
The data to store in cache
Response
boolean
True on success, false otherwise
test
Test to see if the storage handler is available.
test() : boolean
since |
11.1. |
---|
Response
boolean
True on success, false otherwise
unlock
Unlock cached item
unlock(string $id, string $group = null) : boolean
since |
11.1 |
---|
Arguments
- $id
string
The cache data id- $group
string
The cache data group
Response
boolean
True on success, false otherwise.
Properties
_root
since |
11.1 |
---|
Type(s)
string
rawname
Rawname
since |
11.1 |
---|
Type(s)
string
_now
Now
since |
11.1 |
---|
Type(s)
\datetime
_lifetime
Cache lifetime
since |
11.1 |
---|
Type(s)
integer
_locking
Locking
since |
11.1 |
---|
Type(s)
boolean
_language
Language
since |
11.1 |
---|
Type(s)
string
_application
Application name.
since |
11.1 |
---|
Type(s)
string
_hash
Hash
since |
11.1 |
---|
Type(s)
string