-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.php
28 lines (22 loc) · 855 Bytes
/
App.php
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
<?php namespace Hampel\JobRunner;
use Hampel\JobRunner\Cli\Logger;
use XF\Container;
class App extends \XF\Cli\App
{
public function initializeExtra()
{
parent::initializeExtra();
$container = $this->container;
/**
* Make sure we never run jobs automatically - make next job.runTime greater than the current time
*
* This also avoids having the autoJobRun registry lookup fail, causing database queries when running
* \XF\Job\Manager::updateNextRunTime
*/
$container['job.runTime'] = \XF::$time + (30*60); // make sure we never run jobs automatically - add 30 minutes to next run time!
$container['cli.output'] = null; // we'll need to set this as to our OutputInterface from our Cli command before we call our logger
$container['cli.logger'] = function (Container $c) {
return new Logger($c['cli.output']);
};
}
}