Cache: ezcCacheStorageFileObject
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcCacheStorageFileObject
|
This cache storage implementation stores arrays, scalar values [
source]
(int, float, string, bool) and objects implementing ezcBaseExportable in files on your hard disk as PHP code. This makes the restoring of cache data extremly fast, since the stored data is simply included and parsed by the PHP interpreter. It takes its base methods from the extended storage base class
ezcCacheStorageFile.
This cache storage deprecates
ezcCacheStorageFileArray, since it is also capable of storing exportable objects in addition to arrays and scalar values.
- ezcCacheStorageFileEvalArray
- ezcCacheStorageFilePlain
Both of these use different methods for actually storing the data, which are basically not superior to the implementation in this class.
Parents
ezcCacheStorage
|
--ezcCacheStorageFile
|
--ezcCacheStorageFileObject
Inherited Member Variables
From
ezcCacheStorageFile:
From
ezcCacheStorage:
Method Summary
|
protected mixed |
fetchData(
$filename )
Fetch data from the cache. |
|
protected string |
prepareData(
$data )
Serialize the data for storing. |
Inherited Methods
From
ezcCacheStorageFile :
From
ezcCacheStorage :
Methods
fetchData
mixed fetchData(
string
$filename )
Fetch data from the cache.
This method fetches the desired data from the file with $filename from disk. This implementation uses an include statement for fetching. The return value depends on the stored data and might either be an object implementing
ezcBaseExportable, an array or a scalar value.
Parameters
| Name |
Type |
Description |
$filename |
string |
|
Redefinition of
prepareData
string prepareData(
mixed
$data )
Serialize the data for storing.
Serializes the given $data to a executable PHP code representation string. This works with objects implementing
ezcBaseExportable, arrays and scalar values (int, bool, float, string). The return value is executable PHP code to be stored to disk. The data can be unserialized using the
fetchData() method.
Parameters
| Name |
Type |
Description |
$data |
mixed |
|
Throws
| Class | Description |
ezcCacheInvalidDataException |
if the $data can not be serialized (e.g. an object that does not implement ezcBaseExportable, a resource, ...). |
Redefinition of
Last updated: Mon, 21 Dec 2009