Cache: ezcCacheStorageFilePlain
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcCacheStorageFilePlain
|
This class implements a simple storage to cache plain text on the filesystem. It takes it's base methods from the extended storage base class
ezcCacheStorageFile. [
source]
In contrast to other
ezcCacheStorageFile implementations, the stored cache data is restored using PHP's file_get_contents() class. This cache is not capable to store array values. If numeric values are stored the restored values will be of type string. The same applies to values of the simple type bool. It is highly recommended that you cast the resulting value to it's correct type, also PHP will automatically perform this cast when necessary. An explicit cast ensures, that type consistant comparisons (using the === or !== operators) will not fail on restored cache data.
- ezcCacheStorageFileArray
- ezcCacheStorageFilePlain
Parents
ezcCacheStorage
|
--ezcCacheStorageFile
|
--ezcCacheStorageFilePlain
Inherited Member Variables
From
ezcCacheStorageFile:
From
ezcCacheStorage:
Method Summary
Inherited Methods
From
ezcCacheStorageFile :
From
ezcCacheStorage :
Methods
fetchData
string fetchData(
string
$filename )
Fetch data from the cache.
This method does the fetching of the data itself. In this case, the method simply includes the file and returns the value returned by the include (or false on failure).
Parameters
| Name |
Type |
Description |
$filename |
string |
The file to fetch data from. |
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 |
Throws
| Class | Description |
ezcCacheInvalidDataException |
If the data submitted is an array,object or a resource, since this implementation of ezcCacheStorageFile can only deal with scalar values. |
Redefinition of
restoreMetaData
Restores and returns the meta data struct.
This method fetches the meta data stored in the storage and returns the according struct of type
ezcCacheStackMetaData. The meta data must be stored inside the storage, but should not be visible as normal cache items to the user.
Redefinition of
storeMetaData
Stores the given meta data struct.
This method stores the given $metaData inside the storage. The data must be stored with the same mechanism that the storage itself uses. However, it should not be stored as a normal cache item, if possible, to avoid accedental user manipulation.
Parameters
Redefinition of
Last updated: Mon, 05 Jan 2009