hmazter/laravel-schedule-list
Composer 安装命令:
composer require hmazter/laravel-schedule-list
包简介
Laravel package to add command to list all scheduled artisan commands
README 文档
README
Laravel 5.6+ package to add a artisan command to list all scheduled artisan commands. With schedule time (cron expression), the command to execute and the command description.
Install
Require this package with composer using the following command:
composer require hmazter/laravel-schedule-list
Note! For Laravel version 5.5 and below use 0.2.0 tag.
Usage
Usage from the command line to show all your scheduled artisan commands:
php artisan schedule:list
Outputs:
+--------------+---------------------+--------------+-------------------------------+
| expression | next run at | command | description |
+--------------+---------------------+--------------+-------------------------------+
| 0 14 * * 3 * | 2017-08-16 14:00:00 | email:export | Export users to email service |
+--------------+---------------------+--------------+-------------------------------+
Crontab style output
Use --cron to show the output in the same style as it would go in a crontab file.
Outputs:
0 14 * * 3 * '/usr/local/bin/php' 'artisan' email:export > '/dev/null' 2>&1`
Verbose output
Use -vv to show the full command, including php binary path and output path.
Outputs:
+--------------+---------------------+----------------------------------------------------------------+-------------------------------+
| expression | next run at | command | description |
+--------------+---------------------+----------------------------------------------------------------+-------------------------------+
| 0 14 * * 3 * | 2017-08-16 14:00:00 | '/usr/local/bin/php' 'artisan' email:export > '/dev/null' 2>&1 | Export users to email service |
+--------------+---------------------+----------------------------------------------------------------+-------------------------------+
Using -vv together with --cron does not change to output from normal --cron output.
Programmatic use
For occasions when you need to access the list of scheduled events programmatically
\Hmazter\LaravelScheduleList\ScheduleList::all exists that will return all the scheduled events as an array of ScheduleEvent.
Inject the ScheduleList or resolve it from the Container and then call all() to get all scheduled events.
Usage of it can be seen in ListScheduler::handle
Define PHP Binary Path
If you use custom PHP Binary paths or you are using \Hmazter\LaravelScheduleList\ScheduleList::all within the context of a web application and not through the console, you can publish the package config file and defining your own binary path:
php artisan vendor:publish --provider="Hmazter\LaravelScheduleList\ScheduleListServiceProvider" --tag="config"
For example config/schedule-list.php:
<?php
return [
'remove_strings_from_command' => [
"'".PHP_BINARY."'",
"'artisan'",
],
];
Known limitations
Laravel ships with some special scheduling functions ex between, unlessBetween, when and skip
these are not handled right now in the schedule listing output.
They are evaluated at each execution of the schedule and does not define any expression that can be included in the table.
hmazter/laravel-schedule-list 适用场景与选型建议
hmazter/laravel-schedule-list 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 437.11k 次下载、GitHub Stars 达 94, 最近一次更新时间为 2015 年 08 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「console」 「artisan」 「laravel5」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hmazter/laravel-schedule-list 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hmazter/laravel-schedule-list 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hmazter/laravel-schedule-list 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
Collection of handy Laravel artisan commands that most projects needs
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Laravel helpers for dev
统计信息
- 总下载量: 437.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 97
- 点击次数: 26
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-13