aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorLEZY Thomas <thomas.gif.91@gmail.com>2014-05-29 17:26:58 +0200
committerLEZY Thomas <thomas.gif.91@gmail.com>2014-05-29 17:29:22 +0200
commit03e0e736ab054d8ad355012f5d34cfccb56c7955 (patch)
tree225004fe851c78198301ce58152e59d0882252de /phpBB
parent7508d2b546392c4a1e3ae4ea48cb45ebc502e5e7 (diff)
downloadforums-03e0e736ab054d8ad355012f5d34cfccb56c7955.tar
forums-03e0e736ab054d8ad355012f5d34cfccb56c7955.tar.gz
forums-03e0e736ab054d8ad355012f5d34cfccb56c7955.tar.bz2
forums-03e0e736ab054d8ad355012f5d34cfccb56c7955.tar.xz
forums-03e0e736ab054d8ad355012f5d34cfccb56c7955.zip
[ticket/12597] Typing corrections and improvement of code consistency
PHPBB3-12597
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/console/command/cron/run.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php
index cb304d9161..07949cc962 100644
--- a/phpBB/phpbb/console/command/cron/run.php
+++ b/phpBB/phpbb/console/command/cron/run.php
@@ -60,7 +60,7 @@ class run extends \phpbb\console\command\command
}
/**
- * Executes the function.
+ * Executes the command cron:run.
*
* Tries to acquire the cron lock, then if no argument has been given runs all ready cron tasks.
* If the cron lock can not be obtained, an error message is printed
@@ -89,8 +89,7 @@ class run extends \phpbb\console\command\command
}
else
{
- $this->run_all($input, $output);
- return 0;
+ return $this->run_all($input, $output);
}
}
else
@@ -101,15 +100,15 @@ class run extends \phpbb\console\command\command
}
/*
- * Executes the command in the case when no argument was given.
+ * Executes all ready cron tasks.
*
- * If verbose mode is set, an info message will be printed if their is no task to
+ * If verbose mode is set, an info message will be printed if there is no task to
* be run, or else for each starting task.
*
* @see execute
* @param InputInterface $input The input stream used to get the argument and verboe option.
* @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
- * @return null
+ * @return int 0
*/
protected function run_all(InputInterface $input, OutputInterface $output)
{
@@ -134,13 +133,15 @@ class run extends \phpbb\console\command\command
$output->writeln('<info>' . $this->user->lang('CRON_NO_TASK') . '</info>');
}
}
+
$this->lock_db->release();
+ return 0;
}
/*
- * Executes the command in the case where an argument is given.
+ * Executes a given cron task, if it is ready.
*
- * If their is a task whose name matches the argument, it is run and 0 is returned.
+ * If there is a task whose name matches the argument, it is run and 0 is returned.
* and if verbose mode is set, print an info message with the name of the task.
* If there is no task matching $task_name, the function prints an error message
* and returns with status 2.
@@ -162,11 +163,13 @@ class run extends \phpbb\console\command\command
}
$task->run();
+ $this->lock_db->release();
return 0;
}
else
{
$output->writeln('<error>' . $this->user->lang('CRON_NO_SUCH_TASK') . '</error>');
+ $this->lock_db->release();
return 2;
}
}