cron_manager = $cron_manager; $this->lock_db = $lock_db; $this->user = $user; parent::__construct(); } protected function configure() { $this ->setName('cron:execute-all') ->setDescription($this->user->lang('CLI_DESCR_CRON_EXECUTE_ALL')) ; } protected function execute(InputInterface $input, OutputInterface $output) { if ($this->lock_db->acquire()) { $run_tasks = $this->cron_manager->find_all_ready_tasks(); foreach ($run_tasks as $task) { if ($input->getOption('verbose')) { $output->writeln($this->user->lang('RUNNING_TASK', $task->get_name()) . "\n"); } $task->run(); } $this->lock_db->release(); } else { $output->writeln('' . $this->user->lang('CRON_LOCK_ERROR') . ''); } } }