示例#1
0
    require __DIR__ . '/bootstrap.php';
    // Let's not break everything if new config isn't set
    if (!defined('FAVICON_DEFAULT')) {
        define('FAVICON_DEFAULT', 'default.ico');
    }
    if (!defined('FAVICON_CACHE_DURATION')) {
        define('FAVICON_CACHE_DURATION', 3600 * 24 * 30);
    }
    if (isset($argv[1])) {
        if ($argv[1] == '--daemon') {
            // daemon mode
            while (true) {
                $controller = new CronController();
                $controller->verbose = false;
                $success = $controller->fetchAll();
                unset($controller);
                if (!$success) {
                    sleep(30);
                }
            }
        }
    } else {
        // standard mode
        $controller = new CronController();
        $controller->check();
        $controller->run();
    }
} else {
    // TODO webcron
    die;
}