TYPO3 API  SVNRelease
AutoPublishTask.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003  *  Copyright notice
00004  *
00005  *  (c) 2010-2011 Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
00006  *  All rights reserved
00007  *
00008  *  This script is part of the TYPO3 project. The TYPO3 project is
00009  *  free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  The GNU General Public License can be found at
00015  *  http://www.gnu.org/copyleft/gpl.html.
00016  *
00017  *  This script is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU General Public License for more details.
00021  *
00022  *  This copyright notice MUST APPEAR in all copies of the script!
00023  ***************************************************************/
00024 
00025 /**
00026  * This class provides a wrapper around the autopublication
00027  * mechanism of workspaces, as a Scheduler task
00028  *
00029  * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
00030  * @package Workspaces
00031  * @subpackage Service
00032  */
00033 class tx_Workspaces_Service_AutoPublishTask extends tx_scheduler_Task {
00034 
00035     /**
00036      * Method executed from the Scheduler.
00037      * Call on the workspace logic to publish workspaces whose publication date
00038      * is in the past
00039      *
00040      * @return  void
00041      */
00042     public function execute() {
00043         $autopubObj = t3lib_div::makeInstance('tx_Workspaces_Service_AutoPublish');
00044             // Publish the workspaces that need to be
00045         $autopubObj->autoPublishWorkspaces();
00046             // There's no feedback from the publishing process,
00047             // so there can't be any failure.
00048             // TODO: This could certainly be improved.
00049         return TRUE;
00050     }
00051 }
00052 
00053 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Service/AutoPublishTask.php'])) {
00054     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Service/AutoPublishTask.php']);
00055 }
00056 ?>