PHP Class Bolt\Cron

To create a listener you need to something similar in your class: use Bolt\Events\CronEvents; $this->app['dispatcher']->addListener(CronEvents::CRON_INTERVAL, [$this, 'myJobCallbackMethod']); CRON_INTERVAL should be replace with one of the following: * CRON_HOURLY * CRON_DAILY * CRON_WEEKLY * CRON_MONTHLY * CRON_YEARLY
Author: Gawain Lynch ([email protected])
Inheritance: extends Symfony\Component\EventDispatcher\Event
Show file Open project: bolt/bolt Class Usage Examples

Public Properties

Property Type Description
$lastruns array

Protected Properties

Property Type Description
$repository Bolt\Storage\Repository\CronRepository

Public Methods

Method Description
__construct ( Silex\Application $app, Symfony\Component\Console\Output\OutputInterface $output = null ) Constructor.
execute ( array $param = [] ) : boolean Run the jobs.

Private Methods

Method Description
executeSingle ( CronEvent $event, string $interimName, array $data ) Run a single cron dispatcher.
getNextRunTime ( string $interimName, Bolt\Storage\Entity\Cron $runEntity ) : DateTime Get the next run time for a given interim.
getRunTimes ( ) Query table for last run time of each interim.
getScheduleThreshold ( ) Get our configured hour and convert it to UNIX time.
handleError ( Exception $e, string $interimName ) Provide feedback on exceptions in cron jobs.
isExecutable ( string $interimName ) : boolean Test whether or not to call dispatcher.
notify ( string $message ) If we're passed an OutputInterface, we're called from Nut and can notify the end user.

Method Details

__construct() public method

Constructor.
public __construct ( Silex\Application $app, Symfony\Component\Console\Output\OutputInterface $output = null )
$app Silex\Application
$output Symfony\Component\Console\Output\OutputInterface

execute() public method

Run the jobs.
public execute ( array $param = [] ) : boolean
$param array
return boolean

Property Details

$lastruns public property

public array $lastruns
return array

$repository protected property

protected CronRepository,Bolt\Storage\Repository $repository
return Bolt\Storage\Repository\CronRepository