From 6f279c1bf47c4c86a507acc9ea7d705dad6e9b97 Mon Sep 17 00:00:00 2001 From: LEZY Thomas Date: Wed, 28 May 2014 14:39:02 +0200 Subject: [ticket/12597] Update pull-request Removes a useless comment. Switchs command name from cron:execute-all to cron:run-all. Replaces assertEquals by assertSame PHPBB3-12597 --- phpBB/phpbb/console/command/cron/execute_all.php | 87 ------------------------ phpBB/phpbb/console/command/cron/run_all.php | 87 ++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 87 deletions(-) delete mode 100644 phpBB/phpbb/console/command/cron/execute_all.php create mode 100644 phpBB/phpbb/console/command/cron/run_all.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/cron/execute_all.php b/phpBB/phpbb/console/command/cron/execute_all.php deleted file mode 100644 index f7157f4d3a..0000000000 --- a/phpBB/phpbb/console/command/cron/execute_all.php +++ /dev/null @@ -1,87 +0,0 @@ -cron_manager = $cron_manager; - $this->lock_db = $lock_db; - $this->user = $user; - parent::__construct(); - } - - /** - * Sets the command name and description - * - * @return null - */ - protected function configure() - { - $this - ->setName('cron:execute-all') - ->setDescription($this->user->lang('CLI_DESCR_CRON_EXECUTE_ALL')) - ; - } - - /** - * Executes the function. Each cron tasks is executed. - * If option "--verbose" is not seted, there will be no output in case of - * successful execution. - * - * @param InputInterface input The input stream, unused here - * @param OutputInterface output The output stream, used for printig verbose-mode - * and error information. - * @return null - */ - 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())); - } - - $task->run(); - } - $this->lock_db->release(); - } - else - { - $output->writeln('' . $this->user->lang('CRON_LOCK_ERROR') . ''); - } - } -} diff --git a/phpBB/phpbb/console/command/cron/run_all.php b/phpBB/phpbb/console/command/cron/run_all.php new file mode 100644 index 0000000000..39b3e0c616 --- /dev/null +++ b/phpBB/phpbb/console/command/cron/run_all.php @@ -0,0 +1,87 @@ +cron_manager = $cron_manager; + $this->lock_db = $lock_db; + $this->user = $user; + parent::__construct(); + } + + /** + * Sets the command name and description + * + * @return null + */ + protected function configure() + { + $this + ->setName('cron:run-all') + ->setDescription($this->user->lang('CLI_DESCR_CRON_EXECUTE_ALL')) + ; + } + + /** + * Executes the function. Each cron tasks is executed. + * If option "--verbose" is not seted, there will be no output in case of + * successful execution. + * + * @param InputInterface input The input stream, unused here + * @param OutputInterface output The output stream, used for printig verbose-mode + * and error information. + * @return null + */ + 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())); + } + + $task->run(); + } + $this->lock_db->release(); + } + else + { + $output->writeln('' . $this->user->lang('CRON_LOCK_ERROR') . ''); + } + } +} -- cgit v1.2.1