PHPackages                             leistar/thinkphp5.1-crontab - 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. [CLI &amp; Console](/categories/cli)
4. /
5. leistar/thinkphp5.1-crontab

ActiveThink-extend[CLI &amp; Console](/categories/cli)

leistar/thinkphp5.1-crontab
===========================

使用shell单一入口管理项目中的计划任务

2.0.0(7y ago)2111Apache-2.0PHPPHP &gt;=5.6.0

Since Apr 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jadechenlei/thinkphp5.1-crontab)[ Packagist](https://packagist.org/packages/leistar/thinkphp5.1-crontab)[ RSS](/packages/leistar-thinkphp51-crontab/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

thinkphp5.1-crontab
===================

[](#thinkphp51-crontab)

项目目标：
-----

[](#项目目标)

> 项目中往往因为有非常多的计划任务而变的难以维护。且每次都需要麻烦运维，也不是一件很好的事情。看了很多大神写的计划任务工具，但是都是在php层级循环调用子任务。这样难免会产生同步阻塞的问题。因此萌发了“使用shell单一入口管理项目中的计划任务”的想法；

安装
--

[](#安装)

> composer require leistar/thinkphp5.1-crontab

开始使用
----

[](#开始使用)

1. 将cron.sh和task(注意没有后缀名)文件复制到你服务器中任意目录；(例如复制到项目根目录，和think文件平级)
2. 修改cron.sh文件，将其中的php路径和文件路径修改正确
3. 创建自定义命令，请参考：[创建自定义指令](https://www.kancloud.cn/manual/thinkphp5_1/354146/ "创建自定义指令")
4. 需要加入计划任务的命令，要求继承thinkphp5.1-crontab项目的Task基类；并实现schedule(),configure(),execute()三个方法。
5. 将命令名写在第一步的task文件中。
6. 可参考项目中的demo. 特别注意：demo中的类可能会有命名空间的问题，并不一定能实现功能。只是参考使用
7. 将sh加入到计划任务中

```
*/1 * * * * /mnt/d/wwwroot/tp5/cron.sh >> /mnt/d/wwwroot/cron.log

```

特别鸣谢
----

[](#特别鸣谢)

- 文网亿联公司\[张松\]提供的技术及思路支持;
- 使用了[yunwuxin/think-cron](https://packagist.org/packages/yunwuxin/think-cron/ "创建自定义指令")项目中的部分代码

写在最后
----

[](#写在最后)

- 代码中有很多不成熟的地方，期待您的issue。最好能fork，将您的想法贡献出来。让这个项目更适应更多的场景。
- 邮箱：

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Every ~0 days

Total

5

Last Release

2590d ago

Major Versions

1.1.3 → 2.0.02019-04-12

### Community

Maintainers

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

---

Top Contributors

[![jadechenlei](https://avatars.githubusercontent.com/u/6230232?v=4)](https://github.com/jadechenlei "jadechenlei (1 commits)")

---

Tags

croncrontabthinkphp

### Embed Badge

![Health badge](/badges/leistar-thinkphp51-crontab/health.svg)

```
[![Health](https://phpackages.com/badges/leistar-thinkphp51-crontab/health.svg)](https://phpackages.com/packages/leistar-thinkphp51-crontab)
```

###  Alternatives

[zenstruck/schedule-bundle

Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.

4041.0M2](/packages/zenstruck-schedule-bundle)[jmose/command-scheduler-bundle

This Symfony bundle will allow you to schedule all your commands just like UNIX crontab

3361.4M1](/packages/jmose-command-scheduler-bundle)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[aplus/cli

Aplus Framework CLI Library

2301.7M6](/packages/aplus-cli)[mult1mate/cron-manager

Flexible cron tasks manager for MVC-type applications

40338.5k3](/packages/mult1mate-cron-manager)[mybuilder/cronos-bundle

Symfony 4/5/6 bundle which allows you to use @Cron annotations to configure cron to run your console commands.

89486.1k1](/packages/mybuilder-cronos-bundle)

PHPackages © 2026

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