mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12597] Fix various problems
Actually fix the return status of command cron:run-all Fix some doc block coding style issue Fix missing and obsolete file headers Delete a useless constructor method PHPBB3-12597
This commit is contained in:
parent
18875894ec
commit
61ad42790f
3 changed files with 35 additions and 16 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue