Exemplo n.º 1
0
#!/bin/bash
<?php 
/**
 * Created by PhpStorm.
 * User: Jenner
 * Date: 2015/10/6
 * Time: 16:12
 */
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
try {
    $crontab = new Crontab();
    $crontab->start();
} catch (Exception $e) {
    $crontab->keepPidFile();
    echo "Exception:" . $e->getMessage() . PHP_EOL;
    echo $e->getTraceAsString() . PHP_EOL;
}
class Crontab
{
    /**
     * @var \Jenner\Crontab\AbstractDaemon
     */
    protected $daemon;
    /**
     * @var array
     */
    protected $params;
    /**
     * @var string crontab missions config file
     */
    protected $config_file;