kozo/mechanical

此包的最新版本(5.0.0)没有可用的许可证信息。

维护者

详细信息

github.com/kozo/mechanical

源码

问题

安装量: 1,718

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 1

开放问题: 0

类型:cakephp-plugin

5.0.0 2023-12-06 09:03 UTC

This package is auto-updated.

Last update: 2024-09-06 10:43:54 UTC


README

要求

  • CakePHP5.0 或更高版本

安装

composer require kozo/mechanical

创建quartz文件。

php bin/cake.php mechanical create

编辑mechanical文件。

app/Quartz/MechanicalCron.php

// sample
<?php

namespace App\Mechanical;

use Watchmaker\Watchmaker;

class MechanicalCron {

    public function handle(Watchmaker $watchmaker): Watchmaker
    {
        $i = $watchmaker->task('php hoge/fuga.php');
        $i = $i
            ->month(1)
            ->day(5);
        $watchmaker->add($i);

        $j = $watchmaker->task('php hoge/hoge.php');
        $j = $j
            ->month(2)
            ->day(6);
        $watchmaker->add($j);

        return $watchmaker;
    }
}

运行命令

显示

显示“crontab”和“Quartz”之间的差异。

php bin/cake.php mechanical show

安装

安装“crontab”和“Quartz”之间的差异。

php bin/cake.php mechanical install