承接 gumphp/think-crontab 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gumphp/think-crontab

最新稳定版本:v1.0.2

Composer 安装命令:

composer require gumphp/think-crontab

包简介

workerman/crontab for thinkphp

README 文档

README

composer require gumphp/think-crontab

使用

<?php
namespace app\crontab;

use gumphp\crontab\Crontab;

class Test extends Crontab
{
    // 每秒执行一次
    protected $rule = '* * * * * *';
    
    public function handle()
    {
        $message = __METHOD__ . "\t" . date('Y-m-d H:i:s') . PHP_EOL;
        error_log($message, 3, runtime_path() . 'debug.log');
    }
}

Test 加入 config/crontab.phphandlers 配置

<?php
return [
    # ...
    'handlers' => [
        \app\crontab\Test::class,
    ],
];

启动守护进程

php think crontab start

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-15