tkachikov/chronos 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tkachikov/chronos

Composer 安装命令:

composer require tkachikov/chronos

包简介

Settings commands for Laravel Scheduling

README 文档

README

Logo

Packagist Version PHP from Packagist Laravel 12.x Laravel 11.x Laravel 10.x Laravel 9.x License: MIT

GitHub stars GitHub issues GitHub last commit Tests

This package for setting commands in schedule.

Installation

Require this package with composer using the following command

composer require tkachikov/chronos

Run Chronos command for install:

php artisan chronos:install

Authorization

In defaults pages open for all users and also without auth middleware.

For open setting pages for authenticated users need uncommented 'auth' middleware in config chronos.php:

return [
    'domain' => env('CHRONOS_DOMAIN'),

    'middlewares' => [
        'web',
        'auth',
        // 'Tkachikov\Chronos\Http\Middleware\Authorize',
    ],
];

For authorization in production uncommented Chronos auth in config chronos.php and set statements in app/Providers/ChronosServiceProvider:

return [
    'domain' => env('CHRONOS_DOMAIN'),

    'middlewares' => [
        'web',
        'auth',
        'Tkachikov\Chronos\Http\Middleware\Authorize',
    ],
];
// ...
class ChronosServiceProvider extends ChronosApplicationServiceProvider
{
    // ...
    protected function gate(): void
    {
        Gate::define('viewChronos', function ($user) {
            return $user->hasRole('admin');
        });
    }
}

Usage

Visit route /chronos, example: localhost:8000/chronos

For testing

Open chronos:test command: Open test

Run chronos:test command from queue and reload page: Run test

Run chronos:test command in real time. Out messages pushing in custom terminal: Run test

Run attributes

If you need off run command from Chronos dashboard (notRunInManual) or schedules (notRunInSchedule) set in ChronosCommand attribute:

// ...
use Tkachikov\Chronos\Attributes\ChronosCommand;

#[ChronosCommand(
    notRunInManual: false,
    notRunInSchedule: true,
)]
class TestCommand extends Command
{
    // ...
}

Logging and states

For logging command messages and set status added trait ChronosRunnerTrait:

// ...
class TestCommand extends Command
{
    use ChronosRunnerTrait;
    // ...
}

Create schedules

Open your command and set params for it in Create schedule and save. Create schedule

For off command click button edit, check to off Run and save: Off schedule

Group name

In default base class name directory for group name.
You must be setting property group in ChronosCommand attribute. Example:

// ...
use Tkachikov\Chronos\Attributes\ChronosCommand;

#[ChronosCommand(
    group: 'MyGroup',
)]
class TestCommand extends Command
{
    // ...
}

Statistics

For calculate statistics run commands you must create schedule for chronos:update-metrics

License

This package is open-sourced software licensed under the MIT license.

tkachikov/chronos 适用场景与选型建议

tkachikov/chronos 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.19k 次下载、GitHub Stars 达 18, 最近一次更新时间为 2024 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「schedule」 「command」 「laravel」 「chronos」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 tkachikov/chronos 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tkachikov/chronos 我们能提供哪些服务?
定制开发 / 二次开发

基于 tkachikov/chronos 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 18
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-26