monthly-by-day engine + recoreco:run (v0.3)
This commit is contained in:
32
Console/RecoRecoCommand.php
Normal file
32
Console/RecoRecoCommand.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Plugin\RecoReco\Console;
|
||||
|
||||
use Kanboard\Console\BaseCommand;
|
||||
use Kanboard\Plugin\RecoReco\Model\RecoRecoModel;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* CLI entry point for the RecoReco engine. Run by cron (four times a day from v1.0). Can be run by
|
||||
* hand to test: ./cli recoreco:run
|
||||
*/
|
||||
class RecoRecoCommand extends BaseCommand
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('recoreco:run')
|
||||
->setDescription('Spawn RecoReco calendar-scheduled cards whose occurrence is due');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$model = new RecoRecoModel($this->container);
|
||||
$count = $model->run();
|
||||
|
||||
$output->writeln('RecoReco: spawned '.$count.' card(s).');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user