| Package | Zend_Cache |
| Subpackage | Zend_Cache_Backend |
| Copyright | Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) |
| License | http://framework.zend.com/license/new-bsd New BSD License |

class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
| Package | Zend_Cache |
| Subpackage | Zend_Cache_Backend |
| Copyright | Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) |
| License | http://framework.zend.com/license/new-bsd New BSD License |
| # $_metadatasArray | Array of metadatas (each item is an associative array) |
| # $_options | Available options |
| + ___expire() | PUBLIC METHOD FOR UNIT TESTING ONLY ! |
| + __construct() | Constructor |
| # _clean() | Clean some cache records (protected method used for recursive stuff) |
| # _cleanMetadatas() | Clear the metadatas array |
| # _delMetadatas() | Drop a metadata record |
| # _expireTime() | Compute & return the expire time |
| # _file() | Make and return a file name (with path) |
| # _fileGetContents() | Return the file content of the given file |
| # _fileNameToId() | Transform a file name into cache id and return it |
| # _filePutContents() | Put the given string into the given file |
| # _get() | |
| # _getMetadatas() | Get a metadatas record |
| # _hash() | Make a control key with the string containing datas |
| # _idToFileName() | Transform a cache id into a file name and return it |
| # _isMetadatasFile() | Check if the given filename is a metadatas one |
| # _loadMetadatas() | Load metadatas from disk |
| # _metadatasFile() | Make and return a file name (with path) for metadatas |
| # _path() | Return the complete directory path of a filename (including hashedDirectoryStructure) |
| # _recursiveMkdirAndChmod() | Make the directory strucuture for the given id |
| # _remove() | Remove a file |
| # _saveMetadatas() | Save metadatas to disk |
| # _setMetadatas() | Set a metadatas record |
| # _test() | Test if the given cache id is available (and still valid as a cache record) |
| + clean() | Clean some cache records |
| + getCapabilities() | Return an associative array of capabilities (booleans) of the backend |
| + getFillingPercentage() | Return the filling percentage of the backend storage |
| + getIds() | Return an array of stored cache ids |
| + getIdsMatchingAnyTags() | Return an array of stored cache ids which match any given tags |
| + getIdsMatchingTags() | Return an array of stored cache ids which match given tags |
| + getIdsNotMatchingTags() | Return an array of stored cache ids which don't match given tags |
| + getMetadatas() | Return an array of metadatas for the given cache id |
| + getTags() | Return an array of stored tags |
| + load() | Test if a cache is available for the given id and (if yes) return it (false else) |
| + remove() | Remove a cache record |
| + save() | Save some string datas into a cache record |
| + setCacheDir() | Set the cache_dir (particular case of setOption() method) |
| + test() | Test if a cache is available or not (for the given id) |
| + touch() | Give (if possible) an extra lifetime to the given cache id |
protected $_metadatasArray = array()protected $_options = array(
'cache_dir' => null,
'file_locking' => true,
'read_control' => true,
'read_control_type' => 'crc32',
'hashed_directory_level' => 0,
'hashed_directory_umask' => 0700,
'file_name_prefix' => 'zend_cache',
'cache_file_umask' => 0600,
'metadatas_array_max_size' => 100
)
public function ___expire( |
$id)
|
string $id |
cache id |
public function __construct( |
array $options = array())
|
protected function _clean( |
$dir)
|
Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tagsZend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tagsstring $dir |
Directory to clean |
string $mode |
Clean mode |
array $tags |
Array of tags |
Zend_Cache_Exception
protected function _cleanMetadatas( |
)
|
protected function _delMetadatas( |
$id)
|
string $id |
Cache id |
protected function _expireTime( |
$lifetime)
|
$lifetime |
protected function _file( |
$id)
|
string $id |
Cache id |
protected function _fileGetContents( |
$file)
|
string $file |
File complete path |
protected function _fileNameToId( |
$fileName)
|
string $fileName |
File name |
protected function _filePutContents( |
$file)
|
string $file |
File complete path |
string $string |
String to put in file |
protected function _get( |
$dir)
|
$dir |
|
$mode |
|
$tags |
protected function _getMetadatas( |
$id)
|
string $id |
Cache id |
protected function _hash( |
$data)
|
string $data |
Data |
string $controlType |
Type of control 'md5', 'crc32' or 'strlen' |
Zend_Cache_Exception
protected function _idToFileName( |
$id)
|
string $id |
Cache id |
protected function _isMetadatasFile( |
$fileName)
|
string $fileName |
File name |
protected function _loadMetadatas( |
$id)
|
string $id |
Cache id |
protected function _metadatasFile( |
$id)
|
string $id |
Cache id |
protected function _path( |
$id)
|
string $id |
Cache id |
boolean $parts |
if true, returns array of directory parts instead of single string |
protected function _recursiveMkdirAndChmod( |
$id)
|
string $id |
cache id |
protected function _remove( |
$file)
|
string $file |
Complete file path |
protected function _saveMetadatas( |
$id)
|
string $id |
Cache id |
array $metadatas |
Associative array |
protected function _setMetadatas( |
$id)
|
string $id |
Cache id |
array $metadatas |
Associative array of metadatas |
boolean $save |
optional pass false to disable saving to file |
protected function _test( |
$id)
|
string $id |
Cache id |
boolean $doNotTestCacheValidity |
If set to true, the cache validity won't be tested |
public function clean( |
$mode = Zend_Cache::CLEANING_MODE_ALL)
|
string $mode |
clean mode |
tags array $tags |
array of tags |
public function getCapabilities( |
)
|
public function getFillingPercentage( |
)
|
Zend_Cache_Exception
public function getIds( |
)
|
public function getIdsMatchingAnyTags( |
$tags = array())
|
array $tags |
array of tags |
public function getIdsMatchingTags( |
$tags = array())
|
array $tags |
array of tags |
public function getIdsNotMatchingTags( |
$tags = array())
|
array $tags |
array of tags |
public function getMetadatas( |
$id)
|
string $id |
cache id |
public function getTags( |
)
|
public function load( |
$id)
|
string $id |
cache id |
boolean $doNotTestCacheValidity |
if set to true, the cache validity won't be tested |
public function remove( |
$id)
|
string $id |
cache id |
public function save( |
$data)
|
string $data |
Datas to cache |
string $id |
Cache id |
array $tags |
Array of strings, the cache record will be tagged by each string entry |
int $specificLifetime |
If != false, set a specific lifetime for this cache record (null => infinite lifetime) |
public function setCacheDir( |
$value)
|
string $value |
|
boolean $trailingSeparator |
If true, add a trailing separator is necessary |
Zend_Cache_Exception
public function test( |
$id)
|
string $id |
cache id |
public function touch( |
$id)
|
string $id |
cache id |
int $extraLifetime |