047281457b8128d9e2a598af641a118e4131ad03
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Classes / Service / AutoPublishTask.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010-2011 Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * This class provides a wrapper around the autopublication
27 * mechanism of workspaces, as a Scheduler task
28 *
29 * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
30 * @package Workspaces
31 * @subpackage Service
32 */
33 class tx_Workspaces_Service_AutoPublishTask extends tx_scheduler_Task {
34
35 /**
36 * Method executed from the Scheduler.
37 * Call on the workspace logic to publish workspaces whose publication date
38 * is in the past
39 *
40 * @return void
41 */
42 public function execute() {
43 $autopubObj = t3lib_div::makeInstance('tx_Workspaces_Service_AutoPublish');
44 // Publish the workspaces that need to be
45 $autopubObj->autoPublishWorkspaces();
46 // There's no feedback from the publishing process,
47 // so there can't be any failure.
48 // TODO: This could certainly be improved.
49 return TRUE;
50 }
51 }
52
53 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Service/AutoPublishTask.php'])) {
54 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Service/AutoPublishTask.php']);
55 }
56 ?>