kozo/mechanical

There is no license information available for the latest version (5.0.0) of this package.

Installs: 1 743

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:cakephp-plugin

5.0.0 2023-12-06 09:03 UTC

This package is auto-updated.

Last update: 2024-11-06 10:58:59 UTC


README

requirements

  • CakePHP5.0 or higher

Installation

composer require kozo/mechanical

create quartz file.

php bin/cake.php mechanical create

edit mechanical file.

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;
    }
}

run command

show

show the difference between "crontab" and "Quartz".

php bin/cake.php mechanical show

install

Install the difference between "crontab" and "Quartz".

php bin/cake.php mechanical install