|
| __construct ($options=array()) |
|
| contains ($id, $group) |
|
| get ($id, $group, $checkTime=true) |
|
| getAll () |
|
| store ($id, $group, $data) |
|
| remove ($id, $group) |
|
| clean ($group, $mode=null) |
|
| gc () |
|
| lock ($id, $group, $locktime) |
|
| unlock ($id, $group=null) |
|
| __construct ($options=array()) |
|
| contains ($id, $group) |
|
| get ($id, $group, $checkTime=true) |
|
| getAll () |
|
| store ($id, $group, $data) |
|
| remove ($id, $group) |
|
| clean ($group, $mode=null) |
|
| flush () |
|
| gc () |
|
| lock ($id, $group, $locktime) |
|
| unlock ($id, $group=null) |
|
|
| _checkExpire ($id, $group) |
|
| _getFilePath ($id, $group) |
|
| _deleteFolder ($path) |
|
| _cleanPath ($path, $ds=DIRECTORY_SEPARATOR) |
|
| _filesInFolder ($path, $filter='.', $recurse=false, $fullpath=false, $exclude=array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter=array('^\..*', '.*~')) |
|
| _folders ($path, $filter='.', $recurse=false, $fullpath=false, $exclude=array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter=array('^\..*')) |
|
| _getCacheId ($id, $group) |
|
File cache storage handler
- Depuis
- 1.7.0
- Note
- For performance reasons this class does not use the Filesystem package's API
◆ __construct()
__construct |
( |
|
$options = array() | ) |
|
Constructor
- Paramètres
-
array | $options | Optional parameters |
- Depuis
- 1.7.0
Références $options, et $path.
◆ _checkExpire()
_checkExpire |
( |
|
$id, |
|
|
|
$group |
|
) |
| |
|
protected |
Check if a cache object has expired
Using @ error suppressor here because between if we did a file_exists() and then filemsize() there will be a little time space when another process can delete the file and then you get PHP Warning
- Paramètres
-
string | $id | Cache ID to check |
string | $group | The cache data group |
- Renvoie
- boolean True if the cache ID is valid
- Depuis
- 1.7.0
Références $id, et $path.
◆ _cleanPath()
Function to strip additional / or \ in a path name
- Paramètres
-
string | $path | The path to clean |
string | $ds | Directory separator (optional) |
- Renvoie
- string The cleaned path
- Depuis
- 1.7.0
Références $path.
◆ _deleteFolder()
◆ _filesInFolder()
_filesInFolder |
( |
|
$path, |
|
|
|
$filter = '.' , |
|
|
|
$recurse = false , |
|
|
|
$fullpath = false , |
|
|
|
$exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX') , |
|
|
|
$excludefilter = array('^\..*', '.*~') |
|
) |
| |
|
protected |
Utility function to quickly read the files in a folder.
- Paramètres
-
string | $path | The path of the folder to read. |
string | $filter | A filter for file names. |
mixed | $recurse | True to recursively search into sub-folders, or an integer to specify the maximum depth. |
boolean | $fullpath | True to return the full path to the file. |
array | $exclude | Array with names of files which should not be shown in the result. |
array | $excludefilter | Array of folder names to exclude |
- Renvoie
- array Files in the given folder.
- Depuis
- 1.7.0
Références $file, $filter, $path, Log\add(), et Log\WARNING.
◆ _folders()
_folders |
( |
|
$path, |
|
|
|
$filter = '.' , |
|
|
|
$recurse = false , |
|
|
|
$fullpath = false , |
|
|
|
$exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX') , |
|
|
|
$excludefilter = array('^\..*') |
|
) |
| |
|
protected |
Utility function to read the folders in a folder.
- Paramètres
-
string | $path | The path of the folder to read. |
string | $filter | A filter for folder names. |
mixed | $recurse | True to recursively search into sub-folders, or an integer to specify the maximum depth. |
boolean | $fullpath | True to return the full path to the folders. |
array | $exclude | Array with names of folders which should not be shown in the result. |
array | $excludefilter | Array with regular expressions matching folders which should not be shown in the result. |
- Renvoie
- array Folders in the given folder.
- Depuis
- 1.7.0
Références $file, $filter, $path, Log\add(), et Log\WARNING.
◆ _getFilePath()
_getFilePath |
( |
|
$id, |
|
|
|
$group |
|
) |
| |
|
protected |
Get a cache file path from an ID/group pair
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
- Renvoie
- boolean|string The path to the data object or boolean false if the cache directory does not exist
- Depuis
- 1.7.0
Références $id, et $name.
◆ clean()
clean |
( |
|
$group, |
|
|
|
$mode = null |
|
) |
| |
Clean cache for a group given a mode.
group mode : cleans all cache in the group notgroup mode : cleans all cache not in the group
- Paramètres
-
string | $group | The cache data group |
string | $mode | The mode for cleaning cache [group|notgroup] |
- Renvoie
- boolean
- Depuis
- 1.7.0
Références $folder, $i, $mode, $n, et $return.
◆ contains()
Check if the cache contains data stored by ID and group
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
- Renvoie
- boolean
- Depuis
- 3.7.0
Références $id.
◆ gc()
Garbage collect expired cache data
- Renvoie
- boolean
- Depuis
- 1.7.0
Références $file, et $files.
◆ get()
get |
( |
|
$id, |
|
|
|
$group, |
|
|
|
$checkTime = true |
|
) |
| |
Get cached data by ID and group
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
boolean | $checkTime | True to verify cache time expiration threshold |
- Renvoie
- mixed Boolean false on failure or a cached data object
- Depuis
- 1.7.0
Références $data, $id, et $path.
◆ getAll()
◆ lock()
lock |
( |
|
$id, |
|
|
|
$group, |
|
|
|
$locktime |
|
) |
| |
Lock cached item
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
integer | $locktime | Cached item max lock time |
- Renvoie
- mixed Boolean false if locking failed or an object containing properties lock and locklooped
- Depuis
- 1.7.0
Références $id, et $path.
◆ remove()
Remove a cached data entry by ID and group
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
- Renvoie
- boolean
- Depuis
- 1.7.0
Références $id, et $path.
◆ store()
store |
( |
|
$id, |
|
|
|
$group, |
|
|
|
$data |
|
) |
| |
Store the data to cache by ID and group
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
string | $data | The data to store in cache |
- Renvoie
- boolean
- Depuis
- 1.7.0
Références $data, $id, et $path.
◆ unlock()
unlock |
( |
|
$id, |
|
|
|
$group = null |
|
) |
| |
Unlock cached item
- Paramètres
-
string | $id | The cache data ID |
string | $group | The cache data group |
- Renvoie
- boolean
- Depuis
- 1.7.0
Références $id, et $path.
◆ $_locked_files
◆ $_root
La documentation de cette classe a été générée à partir du fichier suivant :