PHP Class M1\Vars\Cache\CacheProvider

Since: 0.1.0
Inheritance: use trait M1\Vars\Traits\PathTrait
Datei anzeigen Open project: m1/Vars Class Usage Examples

Public Methods

Method Description
__construct ( string | array $resource, array $options ) Creates a new instance of the cacheProvider for Vars
checkCache ( ) : boolean Checks the cache to see if there is a valid cache available
getAttempted ( ) : boolean Returns if the cache has been attempted
getExpire ( ) : integer Returns how long the cache lasts for
getLoadedVars ( ) : Vars Returns the loaded Vars object
getProvide ( ) : boolean Returns if cache is on or off
getTime ( ) : integer Returns when the cache was made
isHit ( ) : integer Returns how long the cache lasts for
load ( ) Load the cached file into $this->loaded_vars
makeCache ( Vars $vars ) Transfer the contents of the parent Vars object into a file for cache
setProvide ( boolean $provide ) : CacheProvider Set the cache on or off
setTime ( integer $time ) : CacheProvider Sets the time when the Vars was cached

Method Details

__construct() public method

Creates a new instance of the cacheProvider for Vars
public __construct ( string | array $resource, array $options )
$resource string | array The main configuration resource
$options array The options being used for Vars

checkCache() public method

Checks the cache to see if there is a valid cache available
public checkCache ( ) : boolean
return boolean Returns true if has the cached resource

getAttempted() public method

Returns if the cache has been attempted
public getAttempted ( ) : boolean
return boolean Has the cache been attempted

getExpire() public method

Returns how long the cache lasts for
public getExpire ( ) : integer
return integer Cache expire time

getLoadedVars() public method

Returns the loaded Vars object
public getLoadedVars ( ) : Vars
return M1\Vars\Vars The loaded Vars object

getProvide() public method

Returns if cache is on or off
public getProvide ( ) : boolean
return boolean Is cache on or off

getTime() public method

Returns when the cache was made
public getTime ( ) : integer
return integer Cache creation time

isHit() public method

Returns how long the cache lasts for
public isHit ( ) : integer
return integer Cache expire time

load() public method

Load the cached file into $this->loaded_vars
public load ( )

makeCache() public method

Transfer the contents of the parent Vars object into a file for cache
public makeCache ( Vars $vars )
$vars M1\Vars\Vars Parent vars object

setProvide() public method

Set the cache on or off
public setProvide ( boolean $provide ) : CacheProvider
$provide boolean Does the cache want to be on or off
return CacheProvider

setTime() public method

Sets the time when the Vars was cached
public setTime ( integer $time ) : CacheProvider
$time integer Time when vars cached was created
return CacheProvider The cacheProvider object