summaryrefslogtreecommitdiff
path: root/app/Controller/CronjobController.php
blob: 082fadfa5fb7d592567921303d8a08eb966f898c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Kanboard\Controller;

use Kanboard\Controller\BaseController;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;

/**
 * Class CronjobController
 *
 * Runs cron jobs via URL
 *
 * @package Kanboard\Controller
 */
class CronjobController extends BaseController
{
    public function run()
    {
        $this->checkWebhookToken();

        $input = new ArrayInput(array(
           'command' => 'cronjob',
        ));
        $output = new NullOutput();

        $this->cli->setAutoExit(false);
        $this->cli->run($input, $output);

        $this->response->html('Cronjob executed');
    }
}