From 32e4a932c801dfa6c52f6e8211a96bdb7849579d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 27 Jan 2016 21:45:37 -0500 Subject: Added automatic actions based on a daily event --- app/Console/Cronjob.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 app/Console/Cronjob.php (limited to 'app/Console/Cronjob.php') diff --git a/app/Console/Cronjob.php b/app/Console/Cronjob.php new file mode 100644 index 00000000..2b12d93d --- /dev/null +++ b/app/Console/Cronjob.php @@ -0,0 +1,33 @@ +setName('cronjob') + ->setDescription('Execute daily cronjob'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + foreach ($this->commands as $command) { + $job = $this->getApplication()->find($command); + $job->run(new ArrayInput(array('command' => $command)), new NullOutput()); + } + } +} -- cgit v1.2.3