[TASK] Remove superfluous parenthesis in sysexts
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / Classes / Example / SleepTask.php
1 <?php
2 namespace TYPO3\CMS\Scheduler\Example;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2009-2011 Fran├žois Suter <francois@typo3.org>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * Class "tx_scheduler_SleepTask" provides a task that sleeps for some time
28 * This is useful for testing parallel executions
29 *
30 * @author Fran├žois Suter <francois@typo3.org>
31 * @package TYPO3
32 * @subpackage tx_scheduler
33 */
34 class SleepTask extends \TYPO3\CMS\Scheduler\Task {
35
36 /**
37 * Number of seconds the task should be sleeping for
38 *
39 * @var integer $sleepTime
40 */
41 public $sleepTime = 10;
42
43 /**
44 * Function executed from the Scheduler.
45 * Goes to sleep ;-)
46 *
47 * @return boolean
48 */
49 public function execute() {
50 $time = 10;
51 if (!empty($this->sleepTime)) {
52 $time = $this->sleepTime;
53 }
54 sleep($time);
55 return TRUE;
56 }
57
58 /**
59 * This method returns the sleep duration as additional information
60 *
61 * @return string Information to display
62 */
63 public function getAdditionalInformation() {
64 return $GLOBALS['LANG']->sL('LLL:EXT:scheduler/mod1/locallang.xml:label.sleepTime') . ': ' . $this->sleepTime;
65 }
66
67 }
68
69
70 ?>