-
(Boolean) clean ($mode = self::ALL)
Browse code
| $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 = null)
Browse code
| $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 The) getBackend ()
Browse code
Gets the backend object.
returns backend object
-
(int) getLastModified ($key)
Browse code
Returns the last modification date of the given key.
returns The last modified time
-
(integer) getLifetime ($lifetime)
Browse code
| $lifetime |
Lifetime in seconds
|
Computes lifetime.
returns Lifetime in seconds
-
(array) getMany ($keys)
Browse code
Gets many keys at once.
returns An associative array of data from cache
-
(mixed) getOption ($name, $default = null)
Browse code
| $name |
The option name
|
| $default |
The default value
|
Gets an option value.
returns The option value
-
(int) getTimeout ($key)
Browse code
Returns the timeout for the given key.
returns The timeout time
-
Returns true if there is a cache for the given key.
returns true if the cache exists, false otherwise
-
initialize ($options = array())
Browse code
| $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.
=> no automatic cache cleaning
=> 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)
Browse code
Converts a pattern to a regular expression.
A pattern can use some special characters:
returns A regular expression
-
(Boolean) remove ($key)
Browse code
Removes a content from the cache.
returns true if no problem
-
(Boolean) removePattern ($pattern)
Browse code
| $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 = null)
Browse code
| $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)
Browse code
| $name |
The option name
|
| $value |
The option value
|
Sets an option value.
-
__construct ($options = array())
Browse code
Class constructor.