Cache class that stores content in files.
Method Summary
-
removePattern($pattern)
-
getTimeout($key)
-
string
read($path, $type = self::READ_DATA)
Reads the cache file and returns the content.
-
string
getFilePath($key)
Converts a cache key to a full path.
-
initialize($options = array())
Initializes this sfCache instance.
-
get($key, $default = null)
-
remove($key)
-
set($key, $data, $lifetime = null)
-
clean($mode = sfCache::ALL)
-
getLastModified($key)
-
setcache_dir($cache_dir)
Sets the cache root directory.
-
has($key)
-
boolean
write($path, $data, $timeout)
Writes the given data in the cache file.
Methods inherited from sfCache
__construct , removePattern , getTimeout , initialize , get , getLifetime , patternToRegexp , getBackend , remove , set , clean , getLastModified , getOption , has , getMany , setOption
Method Details
-
removePattern ($pattern)
-
getTimeout ($key)
-
(string) read ($path, $type = self::READ_DATA)
| $path |
The file path |
| $type |
The type of data you want to be returned
sfFileCache::READ_DATA: The cache content
sfFileCache::READ_TIMEOUT: The timeout
sfFileCache::READ_LAST_MODIFIED: The last modification timestamp |
Reads the cache file and returns the content.
returns The content of the cache file.
throws sfCacheException
-
(string) getFilePath ($key)
Converts a cache key to a full path.
returns The full path to the cache file
-
initialize ($options = array())
Initializes this sfCache instance.
Available options:
* cache_dir: The directory where to put cache files
* see sfCache for options available for all drivers
-
get ($key, $default = null)
-
remove ($key)
-
set ($key, $data, $lifetime = null)
-
clean ($mode = sfCache::ALL)
-
getLastModified ($key)
-
setcache_dir ($cache_dir)
| $cache_dir |
The directory where to put the cache files |
Sets the cache root directory.
-
has ($key)
-
(boolean) write ($path, $data, $timeout)
| $path |
The file path |
| $data |
The data to put in cache |
| $timeout |
The timeout timestamp |
Writes the given data in the cache file.
returns true if ok, otherwise false
throws sfCacheException
|