承接 cyub/laravel-task-scheduler 相关项目开发

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

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

cyub/laravel-task-scheduler

Composer 安装命令:

composer require cyub/laravel-task-scheduler

包简介

An Lightweight Laravel Task Scheduling Package

README 文档

README

An Lightweight Task Scheduler Package for Laravel 5. This package allows you to dispatch all scheduled jobs and run at the time.

Installation

Require the package

composer require "cyub/laravel-task-scheduler"

After adding the package, add the ServiceProvider to the providers array in config/app.php

'providers' => [
    ...
    Tink\Scheduler\SchedulerServiceProvider::class,
    ...
];

Then, publish the scheduler config and migration the database of scheduler

php artisan scheduler:install

Configuration

After Install the package, You will find the Configuration in config\scheduler.php

return [
    'enable' => true,
    'schedule_table_name' => 'cron_schedule',
    'schedule_generate_every' => 1,
    'schedule_ahead_for' => 50,
    'schedule_lifetime' => 15,
    'history_cleanup_every' => 10,
    'history_success_lifetime' => 600,
    'history_failure_lifetime' => 600,

    'schedules' => [
        'RegisterRedpacket.activate' => [
            'schedule'  => [
                'cron_expr'   => '*/1 * * * *',
            ],
            'run'   => [
                'class' => App\Cron\RegisterRedpacket::class,
                'function'  => 'activate',
                'params'    => ['isSendSmsNotice' => true]
            ],
            'description' => 'activate register redpacket'
        ]
    ]
];

Usage

Dispatch job and run

php artisan scheduler:dispatch

You can use in Cron

* * * * * php /your-application-path/artisan scheduler:dispatch >> /dev/null 2>&1

View the scheduler config

php artisan scheduler:info config

scheduler config

View the scheduler run result stats

php artisan scheduler:info stats

scheduler config

Clean the scheduler cache

php artisan scheduler:clean

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固