easyswoole/crontab

easyswoole extension tool library

Installs: 33 892

Dependents: 5

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 7

Open Issues: 1

pkg:composer/easyswoole/crontab

1.1.2 2025-09-18 19:24 UTC

This package is auto-updated.

Last update: 2025-09-18 19:25:24 UTC


README

Script Test

<?php

use EasySwoole\Crontab\Crontab;
use EasySwoole\Crontab\Tests\Jobs\JobPerMin;

require_once 'vendor/autoload.php';


$http = new Swoole\Http\Server('0.0.0.0', 9501);
$crontab = new Crontab();
$crontab->register(new JobPerMin());

$crontab->attachToServer($http);
$http->on('request', function ($request, $response) use ($crontab) {

    $ret = $crontab->rightNow('JobPerMin');

    $response->header('Content-Type', 'text/plain');
    $response->end('Hello World ' . $ret);
});

$http->start();