SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SlaxWeb\Cache\Handler\File Class Reference
Inheritance diagram for SlaxWeb\Cache\Handler\File:
Inheritance graph
[legend]
Collaboration diagram for SlaxWeb\Cache\Handler\File:
Collaboration graph
[legend]

Public Member Functions

 __construct (string $path, int $maxAge=0)
 
 write (string $name, string $data, int $maxAge=-1)
 
 exists (string $name)
 
 get (string $name)
 
 remove (string $name, bool $partial=false)
 
- Public Member Functions inherited from SlaxWeb\Cache\AbstractHandler
 write (string $name, string $data, int $maxAge=-1)
 
 exists (string $name)
 
 get (string $name)
 
 remove (string $name, bool $partial=false)
 

Protected Member Functions

 removePartial ($name)
 
- Protected Member Functions inherited from SlaxWeb\Cache\AbstractHandler
 prepData (string $data, int $maxAge=-1)
 
 checkData (string $serialized)
 

Protected Attributes

 $path = ""
 
- Protected Attributes inherited from SlaxWeb\Cache\AbstractHandler
 $maxAge = 0
 

Constructor & Destructor Documentation

SlaxWeb\Cache\Handler\File::__construct ( string  $path,
int  $maxAge = 0 
)

Class constructor

The File Cache handler requires the path of the cache location, where the handler will store the cache data to. The constructor simply stores this path to the protected property. The constructor also checks if the handler can write to that location, and throws an exception if that is not the case.

Parameters
string$pathFilesystem location
int$maxAgeDefault maximum age in seconds, default 0
Exceptions
SlaxWeb thrown if the cache filesystem location is not writable

Member Function Documentation

SlaxWeb\Cache\Handler\File::exists ( string  $name)
SlaxWeb\Cache\Handler\File::get ( string  $name)
SlaxWeb\Cache\Handler\File::remove ( string  $name,
bool  $partial = false 
)
SlaxWeb\Cache\Handler\File::removePartial (   $name)
protected

Remove partial

Removes all files containing '$name' from the cache location.

Parameters
string$nameName of the data stored in cache
Returns
bool
SlaxWeb\Cache\Handler\File::write ( string  $name,
string  $data,
int  $maxAge = -1 
)

The documentation for this class was generated from the following file: