kozo / mechanical
Installs: 1 743
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:cakephp-plugin
Requires
- cakephp/bake: ^3.0.0
- cakephp/cakephp: ^5.0
- kozo/watchmaker: 0.1.0
Requires (Dev)
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