Created
September 3, 2012 14:35
-
-
Save janhalfar/3609755 to your computer and use it in GitHub Desktop.
GCJob foomo job example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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