Skip to content

Instantly share code, notes, and snippets.

@janhalfar
Created September 3, 2012 14:35
Show Gist options
  • Save janhalfar/3609755 to your computer and use it in GitHub Desktop.
Save janhalfar/3609755 to your computer and use it in GitHub Desktop.
GCJob foomo job example
<?php
namespace My\Module;
/**
* a sample Foomo Job
*/
class AJob extends \Foomo\Jobs\AbstractJob
{
/*
from some unix documentation:
* * * * * command to be executed
┬ ┬ ┬ ┬ ┬
│ │ │ │ │
│ │ │ │ │
│ │ │ │ └───── day of week (0 - 6) (0 is Sunday, or use names)
│ │ │ └────────── month (1 - 12)
│ │ └─────────────── day of month (1 - 31)
│ └──────────────────── hour (0 - 23)
└───────────────────────── min (0 - 59)
*/
/**
* cron job execution rule
*
* @var string
*/
protected $executionRule = '0 * * * *';
public function getId()
{
return sha1(__CLASS__);
}
public function getDescription()
{
return 'this will show up in the toolbox job list';
}
public function run()
{
// do stuff here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment