Cache: ezcCacheStorageFileEvalArray
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcCacheStorageFileEvalArray
|
This cache storage implementation stores arrays and scalar values (int, [
source]
float, string, bool) in files on your hard disk as PHP code. In contrast to it's sibling class
ezcCacheStorageFileArray, the stored PHP code is not simply required to restore the cache data, but is evaluated using PHP's eval() function. It takes its base methods from the extended storage base class
ezcCacheStorageFile.
Main purpose behind these 2 similar implementations is the following: Most byte code caches are capable of caching code for included files, but not for eval()'ed strings. Therefore the ezcCacheStorageFileEvalarray class will permit you to get your cached data not cached a second time by an accellerator like APC, whereas the
ezcCacheStorageFileArray class will permit you to explicitly allow this. ATTENTION: If you do not use a byte code cache with your PHP installation, the use of
ezcCacheStorageFileArray is recommende over the usage of ezcCacheStorageEvalarray, since eval() is much slower than directly requiring the stored PHP code.
- ezcCacheStorageFileArray
- ezcCacheStorageFilePlain
Parents
ezcCacheStorage
|
--ezcCacheStorageFile
|
--ezcCacheStorageFileEvalArray
Inherited Member Variables
From
ezcCacheStorage:
Method Summary
|
protected mixed |
fetchData(
$filename )
Fetch data from a given file name. |
|
protected string |
prepareData(
$data )
Serialize the data for storing. |
Inherited Methods
From
ezcCacheStorageFile :
From
ezcCacheStorage :
Methods
fetchData
mixed fetchData(
string
$filename )
Fetch data from a given file name.
Parameters
| Name |
Type |
Description |
$filename |
string |
The file to fetch data from. |
See also:
ezcCacheStorageFile::restore().
Redefinition of
prepareData
string prepareData(
mixed
$data )
Serialize the data for storing.
Serializes a PHP variable (except type resource and object) to a executable PHP code representation string.
Parameters
| Name |
Type |
Description |
$data |
mixed |
Simple type or array to serialize. |
Throws
| Class | Description |
ezcCacheInvalidDataException |
If the data submitted is an object or a resource, since this implementation of ezcCacheStorageFile can only deal with scalar and array values. |
Redefinition of
Last updated: Mon, 17 Dec 2007