PHPackages                             jackapi/phpcrontab - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jackapi/phpcrontab

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jackapi/phpcrontab
==================

phpcrontab

v1.0.1(5y ago)59MITPHPPHP &gt;=7.0.0

Since Sep 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jackapi/phpcrontab)[ Packagist](https://packagist.org/packages/jackapi/phpcrontab)[ RSS](/packages/jackapi-phpcrontab/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

PHP 定时任务管理
==========

[](#php-定时任务管理)

- 支持Class执行和Command执行方式

#### 使用swoole4 PHP&gt;=7.0

[](#使用swoole4-php70)

- 安装方式

```
composer require jackapi/phpcrontab dev-master
```

- 使用第三方

```
cron解析 https://github.com/dragonmantank/cron-expression
```

- 使用方法

```
require_once 'vendor/autoload.php';

//crontab表达式 名称 类 执行方法
$crontabData = [
    'debug' => true,
    'log' => "./1.log",
    'cache_data' => "./cache.data",
    'pid' => "./timer.pid",
    'swoole_tick' => [true, 1000],
    ['*/1 * * * *', 'test1', new \Jackapi\testCrontab(), 'whileTest'],
    ['*/2 * * * *', 'test2', new \Jackapi\testCrontab(), 'getDate'],
    ['*/3 * * * *', 'test3', 'date', ''],

];
$crontab = new Jackapi\phpcrontab($crontabData);
$crontab->run();
```

- debug 开启显示日志信息
- log 设置日志路径文件
- cache\_data 设置开启swoole定时器使用，用来存储执行的定时器任务
- pid 存储定时器ID用于终止
- swoole\_tick 开启定时器以及时间周期（毫秒）
- 新增

```
新增swoole定时器
终止swoole定时器
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2096d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae46a449ee6073073e7e0168f43fbd3a9af524f357694169c8eb723ff7a2054d?d=identicon)[jackapi](/maintainers/jackapi)

---

Top Contributors

[![jackapi](https://avatars.githubusercontent.com/u/16495493?v=4)](https://github.com/jackapi "jackapi (8 commits)")[![apizl](https://avatars.githubusercontent.com/u/20496044?v=4)](https://github.com/apizl "apizl (1 commits)")

### Embed Badge

![Health badge](/badges/jackapi-phpcrontab/health.svg)

```
[![Health](https://phpackages.com/badges/jackapi-phpcrontab/health.svg)](https://phpackages.com/packages/jackapi-phpcrontab)
```

###  Alternatives

[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46823.2k3](/packages/pimcore-data-importer)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)[daycry/cronjob

Cronjob library for Codeigniter 4

6937.7k3](/packages/daycry-cronjob)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[fusio/impl

Fusio implementation

1227.4k2](/packages/fusio-impl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
