This topic lists the PHP API functions of the Zend Data Cache.
Function |
Description |
Stores a variable identified by key into the cache. If a namespace is provided, the key is stored under that namespace. Identical keys can exist under different namespaces. |
|
Stores a variable identified by a key into the cache. If a namespace is provided, the key is stored under that namespace. Identical keys can exist under different namespaces. |
|
Fetches data from the cache. The key can be prefixed with a namespace to indicate searching within the specified namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace. |
|
Fetches data from the cache. The key can be prefixed with a namespace to indicate searching within the specified namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace. |
|
Finds and deletes an entry from the cache, using a key to identify it. The key can be prefixed with a namespace to indicate that the key can be deleted within that namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace. |
|
Finds and deletes an entry from the cache, using a key to identify it. The key can be prefixed with a namespace to indicate that the key can be deleted within that namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace. |
|
Deletes all entries from all namespaces in the cache, if a 'namespace' is provided, only the entries in that namespace are deleted. |
|
Deletes all entries from all namespaces in the cache, if a 'namespace' is provided, only the entries in that namespace are deleted. |
Stores a variable identified by key into the cache. If a namespace is provided, the key is stored under that namespace. Identical keys can exist under different namespaces.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
key |
string |
Yes |
The data's key. Optional: prefix with a [namespace::]. |
value |
mixed |
Yes |
Any PHP object that can be serialized. |
ttl |
int |
No |
Time to live, in seconds. The Data Cache keeps an object in the cache as long as the TTL is not expired. Once the TTL is expired, the object is removed from the cache. |
Return Value: boolean - FALSE if cache storing fails, TRUE otherwise.
Stores a variable identified by a key into the cache. If a namespace is provided, the key is stored under that namespace. Identical keys can exist under different namespaces.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
key |
string |
Yes |
The data key. Optional: prefix with a namespace. |
value |
mixed |
Yes |
Any PHP object that can be serialized. |
ttl |
int |
No |
Time to live, in seconds. The Data Cache keeps objects in the cache as long as the TTL is not expired. Once the TTL is expired, the object is removed from the cache. |
Return Value: boolean - FALSE if cache storing fails, TRUE otherwise.
Fetches data from the cache. The key can be prefixed with a namespace to indicate searching within the specified namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
key |
mixed |
Yes |
The data key or an array of data keys. Optional for key's name: prefix with a namespace. |
Return Value: mixed - FALSE if no data that matches the key is found, else it returns the stored data. If an array of keys is given, then an array, which its keys are the original keys and the values, are the corresponding stored data values.
Fetches data from the cache. The key can be prefixed with a namespace to indicate searching within the specified namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
key |
mixed |
Yes |
The data key or an array of data keys. Optional for key's name: prefix with a namespace. |
Return Value: mixed - FALSE if no data that matches the key is found, else it returns the stored data. If an array of keys is given, then an array, which its keys are the original keys and the values, are the corresponding stored data values
Finds and deletes an entry from the cache, using a key to identify it. The key can be prefixed with a namespace to indicate that the key can be deleted within that namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
key |
mixed |
Yes |
The data key or an array of data keys. Optional for key's name: prefix with a namespace. |
Return Value: boolean - TRUE on success, FALSE on failure.
Finds and deletes an entry from the cache, using a key to identify it. The key can be prefixed with a namespace to indicate that the key can be deleted within that namespace only. If a namespace is not provided, the Data Cache searches for the key in the global namespace.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
key |
string |
Yes |
The data key or an array of data keys. Optional for key's name: prefix with a namespace. |
Return Value: boolean - TRUE on success, FALSE on failure or when entry doesn't exist.
Deletes all entries from all namespaces in the cache, if a 'namespace' is provided, only the entries in that namespace are deleted.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
namespace |
string |
Yes |
The data key. Optional: prefix with a namespace. |
Return Value: boolean - If the namespace does not exist or there are no items to clear, the function will return TRUE. The function will return FALSE only in case of error.
Deletes all entries from all namespaces in the cache, if a 'namespace' is provided, only the entries in that namespace are deleted.
Available Since Version: 4.0
Parameter |
Type |
Required |
Description |
namespace |
string |
Yes |
The data key. Optional: prefix with a namespace. |
Return Value: boolean - If the namespace does not exist, or there are no items to clear, the function will return TRUE. The function will return FALSE only in case of error.