-
(Boolean) clean ($mode)
$mode |
The clean mode sfCache::ALL: remove all keys (default) sfCache::OLD: remove all expired keys |
Cleans the cache.
returns true if no problem
-
(mixed) get ($key, $default)
$key |
The cache key |
$default |
The default value is the key does not exist or not valid anymore |
Gets the cache content for a given key.
returns The data of the cache
-
(object) getBackend ()
Gets the backend object.
returns The backend object
-
(int) getLastModified ($key)
Returns the last modification date of the given key.
returns The last modified time
-
(integer) getLifetime ($lifetime)
$lifetime |
Lifetime in seconds |
Computes lifetime.
returns Lifetime in seconds
-
(array) getMany ($keys)
Gets many keys at once.
returns An associative array of data from cache
-
(mixed) getOption ($name, $default)
$name |
The option name |
$default |
The default value |
Gets an option value.
returns The option value
-
(int) getTimeout ($key)
Returns the timeout for the given key.
returns The timeout time
-
(Boolean) has ($key)
Returns true if there is a cache for the given key.
returns true if the cache exists, false otherwise
-
initialize ($options)
$options |
An array of options. Available options: * automatic_cleaning_factor: The automatic cleaning process destroy too old (for the given life time) (default value: 1000) cache files when a new cache file is written. 0 => no automatic cache cleaning 1 => systematic cache cleaning x (integer) > 1 => automatic cleaning randomly 1 times on x cache write * lifetime (optional): The default life time (default value: 86400) |
Initializes this sfCache instance.
throws sfInitializationException If an error occurs while initializing this sfCache instance.
-
(string) patternToRegexp ($pattern)
Converts a pattern to a regular expression.
A pattern can use some special characters:
- * Matches a namespace (foo:*:bar)
- ** Matches one or more namespaces (foo:**:bar)
returns A regular expression
-
(Boolean) remove ($key)
Removes a content from the cache.
returns true if no problem
-
(Boolean) removePattern ($pattern)
$pattern |
The cache key pattern |
Removes content from the cache that matches the given pattern.
returns true if no problem
-
(Boolean) set ($key, $data, $lifetime)
$key |
The cache key |
$data |
The data to put in cache |
$lifetime |
The lifetime |
Saves some data in the cache.
returns true if no problem
-
setOption ($name, $value)
$name |
The option name |
$value |
The option value |
Sets an option value.
-
__construct ()
Class constructor.