PHP Class Bolt\Storage\Database\Schema\Timer

Author: Gawain Lynch ([email protected])
Show file Open project: bolt/bolt

Protected Properties

Property Type Description
$cacheFile Bolt\Filesystem\Handler\FileInterface
$expired boolean

Public Methods

Method Description
__construct ( Bolt\Filesystem\Handler\FileInterface $cacheFile ) Constructor.
isCheckRequired ( ) : boolean Check if we have determined that we need to do a database check.
setCheckExpiry ( ) Set our state as valid by writing the current date/time to the app/cache/dbcheck.ts file.
setCheckRequired ( ) Invalidate our database check by removing the timestamp file from cache.

Method Details

__construct() public method

Constructor.
public __construct ( Bolt\Filesystem\Handler\FileInterface $cacheFile )
$cacheFile Bolt\Filesystem\Handler\FileInterface

isCheckRequired() public method

Check if we have determined that we need to do a database check.
public isCheckRequired ( ) : boolean
return boolean

setCheckExpiry() public method

We only want to do these checks once per hour, per session, since it's pretty time consuming… Unless specifically requested.
public setCheckExpiry ( )

setCheckRequired() public method

Invalidate our database check by removing the timestamp file from cache.
public setCheckRequired ( )

Property Details

$cacheFile protected property

protected FileInterface,Bolt\Filesystem\Handler $cacheFile
return Bolt\Filesystem\Handler\FileInterface

$expired protected property

protected bool $expired
return boolean