aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/console/command/cron/run_all.php23
-rw-r--r--tests/console/cron/run_all_test.php10
-rw-r--r--tests/console/cron/tasks/simple.php18
3 files changed, 35 insertions, 16 deletions
diff --git a/phpBB/phpbb/console/command/cron/run_all.php b/phpBB/phpbb/console/command/cron/run_all.php
index b398e46ab9..2f8166b857 100644
--- a/phpBB/phpbb/console/command/cron/run_all.php
+++ b/phpBB/phpbb/console/command/cron/run_all.php
@@ -1,11 +1,16 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+
namespace phpbb\console\command\cron;
use Symfony\Component\Console\Input\InputInterface;
@@ -54,16 +59,17 @@ class run_all extends \phpbb\console\command\command
/**
* Executes the function.
+ *
* Tries to acquire the cron lock, then runs all ready cron tasks.
* If the cron lock can not be obtained, an error message is printed
- * and the exit status is set to 1.
- *If the verbose option is specified, each start of a task is printed.
- Otherwise there is no output.
+ * and the exit status is set to 1.
+ * If the verbose option is specified, each start of a task is printed.
+ * Otherwise there is no output.
*
* @param InputInterface $input The input stream, unused here
* @param OutputInterface $output The output stream, used for printig verbose-mode
* and error information.
- * @return boolean 0 if all is ok, 1 if a lock error occured
+ * @return int 0 if all is ok, 1 if a lock error occured
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@@ -81,10 +87,13 @@ class run_all extends \phpbb\console\command\command
$task->run();
}
$this->lock_db->release();
+
+ return 0;
}
else
{
$output->writeln('<error>' . $this->user->lang('CRON_LOCK_ERROR') . '</error>');
+ return 1;
}
}
}
diff --git a/tests/console/cron/run_all_test.php b/tests/console/cron/run_all_test.php
index 5306d27094..716ad50d81 100644
--- a/tests/console/cron/run_all_test.php
+++ b/tests/console/cron/run_all_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/console/cron/tasks/simple.php b/tests/console/cron/tasks/simple.php
index b1fd41f34e..c814c29bde 100644
--- a/tests/console/cron/tasks/simple.php
+++ b/tests/console/cron/tasks/simple.php
@@ -1,13 +1,19 @@
<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
class phpbb_cron_task_simple extends \phpbb\cron\task\base
{
- public $executed;
-
- public function __construct()
- {
- $this->executed = false;
- }
+ public $executed = false;
public function get_name()
{