Class FileSystem
File system driver class. For to create, read, update, delete the cache data in file system.
-
Rundiz\SimpleCache\Drivers\FileSystem
implements
Rundiz\SimpleCache\SimpleCacheInterface
Methods summary
public
|
#
__construct( string $cache_path = '', integer $umask = 0002 )
Class constructor
Parameters
- $cache_path
- Path to cache folder. It will be automatically create if not exists or throw an error if it stuck at some where.
- $umask
- See more at http://php.net/manual/en/function.umask.php
Throws
Exception
|
public
boolean
|
#
clear( )
Clear all cache data.
Returns
boolean Return true if cleared successfully. Return false for otherwise.
Implementation of
|
public
boolean
|
#
delete( string $id )
Delete a cache entry.
Parameters
Returns
boolean Return true if cleared successfully. Return false for otherwise.
Implementation of
|
public
mixed
|
#
get( string $id )
Get a cache entry.
Parameters
- $id
- The id of the cache entry to get.
Returns
mixed Return the cached data or return false if that cache id is not exists.
Implementation of
|
public
boolean
|
#
save( string $id, mixed $data, integer $lifetime = 60 )
Save data into the cache.
Save data into the cache.
Parameters
- $id
- The cache id.
- $data
- The cache data.
- $lifetime
- The life time in seconds for this cache. If set to anything else less than 1, it will be automatically set to 60 by default.
Returns
boolean Return true on successfully saved data to the cache, return false for otherwise.
Implementation of
|
Properties summary
protected
string
|
$cache_path
Full path to cache directory.
Full path to cache directory.
|
|
protected
integer
|
$umask
|
|