PHPackages                             banyancheung/cron-task - 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. banyancheung/cron-task

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

banyancheung/cron-task
======================

crontab task component base on swoft

1.0.0(6y ago)548Apache-2.0PHP

Since Jul 4Pushed 6y agoCompare

[ Source](https://github.com/banyancheung/cron-task)[ Packagist](https://packagist.org/packages/banyancheung/cron-task)[ RSS](/packages/banyancheung-cron-task/feed)WikiDiscussions master Synced 2d ago

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

Swoft 定时任务组件
============

[](#swoft-定时任务组件)

swoft定时任务组件，核心大部分基于1.0，在此基础上适配了2.0，实测可用。

安装
--

[](#安装)

- composer command

```
composer require banyancheung/cron-task
```

- composer.json

```
"require": {
    ...
    "banyancheung/cron-task": "dev-master",
    ...
}
```

然后 `composer update` 即可。

使用
--

[](#使用)

1.在`app/beans.php` 文件里的`server`一项，监听 `onPipeMessage` 事件。

[![](https://camo.githubusercontent.com/3fe8fa1459e2ccefaafc5d59c3bb86eef2aabbf0f9d34bae84124f7a9a38c7ff/68747470733a2f2f696d672e79756e6a65732e636f6d2f646f632f63726f6e2d7461736b2f312e706e67)](https://camo.githubusercontent.com/3fe8fa1459e2ccefaafc5d59c3bb86eef2aabbf0f9d34bae84124f7a9a38c7ff/68747470733a2f2f696d672e79756e6a65732e636f6d2f646f632f63726f6e2d7461736b2f312e706e67)

2.在定义好的task注解里，增加 Scheduled 一项。

[![](https://camo.githubusercontent.com/366db165946e5e09ba24b2a8825783f3e736450ae6eb6c57e192f8bdd9cc91bc/68747470733a2f2f696d672e79756e6a65732e636f6d2f646f632f63726f6e2d7461736b2f322e706e67)](https://camo.githubusercontent.com/366db165946e5e09ba24b2a8825783f3e736450ae6eb6c57e192f8bdd9cc91bc/68747470733a2f2f696d672e79756e6a65732e636f6d2f646f632f63726f6e2d7461736b2f322e706e67)

注意：Scheduled里的task属性是必须的，用于定位是哪个Task，也许会有更好的方法。:)

3.应用配置里增加 cron 配置项

[![](https://camo.githubusercontent.com/186ade0c26bf69cdd8cf67be9c0e1f14a452a8cac92afe924b0dca9dbe6dbd16/68747470733a2f2f696d672e79756e6a65732e636f6d2f646f632f63726f6e2d7461736b2f332e706e67)](https://camo.githubusercontent.com/186ade0c26bf69cdd8cf67be9c0e1f14a452a8cac92afe924b0dca9dbe6dbd16/68747470733a2f2f696d672e79756e6a65732e636f6d2f646f632f63726f6e2d7461736b2f332e706e67)

LICENSE
-------

[](#license)

The Component is open-sourced software licensed under the [Apache license](LICENSE).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2553d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2690282?v=4)[Banyan Cheung](/maintainers/banyancheung)[@banyancheung](https://github.com/banyancheung)

---

Top Contributors

[![banyancheung](https://avatars.githubusercontent.com/u/2690282?v=4)](https://github.com/banyancheung "banyancheung (5 commits)")

---

Tags

crontabswoftswooletaskphpcronswooletaskswoft

### Embed Badge

![Health badge](/badges/banyancheung-cron-task/health.svg)

```
[![Health](https://phpackages.com/badges/banyancheung-cron-task/health.svg)](https://phpackages.com/packages/banyancheung-cron-task)
```

###  Alternatives

[pmill/php-scheduler

Simple PHP task scheduler

1734.1k](/packages/pmill-php-scheduler)

PHPackages © 2026

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