Cache class that stores content in a sqlite database.
Inheritence
sfSQLiteCache
<
sfCache
Method Summary
-
__construct($database = null)
Constructor.
-
createSchema()
Creates the database schema.
-
initialize($options = array())
Initializes the cache.
-
string
get($id, $namespace = self::DEFAULT_NAMESPACE, $doNotTestCacheValidity = false)
Tests if a cache is available and (if yes) returns it.
-
boolean
remove($id, $namespace = self::DEFAULT_NAMESPACE)
Removes an element from the cache.
-
boolean
set($id, $namespace = self::DEFAULT_NAMESPACE, $data)
Saves some data in the cache.
-
boolean
clean($namespace = null, $mode = 'all')
Cleans the cache.
-
setDatabase($database)
Sets the database name.
-
__destruct()
Destructor.
-
string
getDatabase()
Gets the database name.
-
lastModified($id, $namespace = self::DEFAULT_NAMESPACE)
-
boolean
has($id, $namespace = self::DEFAULT_NAMESPACE, $doNotTestCacheValidity = false)
Returns true if there is a cache for the given id and namespace.
Methods inherited from sfCache
setLifeTime , get , getLifeTime , remove , set , clean , lastModified , has
Method Details
-
__construct ($database = null)
| $database |
The database name |
Constructor.
-
createSchema ()
Creates the database schema.
throws sfException
-
initialize ($options = array())
| $options |
An array of options Available options:
|
Initializes the cache.
-
(string) get ($id, $namespace = self::DEFAULT_NAMESPACE, $doNotTestCacheValidity = false)
| $id |
The cache id |
| $namespace |
The name of the cache namespace |
| $doNotTestCacheValidity |
If set to true, the cache validity won't be tested |
Tests if a cache is available and (if yes) returns it.
returns The data in the cache (or null if no cache available)
-
(boolean) remove ($id, $namespace = self::DEFAULT_NAMESPACE)
| $id |
The cache id |
| $namespace |
The name of the cache namespace |
Removes an element from the cache.
returns true if no problem
-
(boolean) set ($id, $namespace = self::DEFAULT_NAMESPACE, $data)
| $id |
The cache id |
| $namespace |
The name of the cache namespace |
| $data |
The data to put in cache |
Saves some data in the cache.
returns true if no problem
-
(boolean) clean ($namespace = null, $mode = 'all')
| $namespace |
The name of the cache namespace |
Cleans the cache.
If no namespace is specified all cache files will be destroyed else only cache files of the specified namespace will be destroyed.
returns true if no problem
-
setDatabase ($database)
| $database |
The database name where to store the cache |
Sets the database name.
-
__destruct ()
Destructor.
-
(string) getDatabase ()
Gets the database name.
returns The database name
-
lastModified ($id, $namespace = self::DEFAULT_NAMESPACE)
-
(boolean) has ($id, $namespace = self::DEFAULT_NAMESPACE, $doNotTestCacheValidity = false)
| $id |
The cache id |
| $namespace |
The name of the cache namespace |
| $doNotTestCacheValidity |
If set to true, the cache validity won't be tested |
Returns true if there is a cache for the given id and namespace.
returns true if the cache exists, false otherwise
|