TYPO3 API  SVNRelease
class.tx_version_tasks_autopublish.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2010-2011 François Suter <francois@typo3.org>
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      François Suter <francois@typo3.org>
00030  * @package     TYPO3
00031  * @subpackage  tx_version
00032  *
00033  * $Id: class.tx_scheduler_sleeptask.php 7905 2010-06-13 14:42:33Z ohader $
00034  */
00035 class tx_version_tasks_AutoPublish extends tx_scheduler_Task {
00036 
00037     /**
00038      * Method executed from the Scheduler.
00039      * Call on the workspace logic to publish workspaces whose publication date
00040      * is in the past
00041      *
00042      * @return  void
00043      */
00044     public function execute() {
00045             // Load the workspace library class and instatiate it
00046         require_once(t3lib_extMgm::extPath('version') . 'ws/class.wslib.php');
00047         $autopubObj = t3lib_div::makeInstance('wslib');
00048             // Publish the workspaces that need to be
00049         $autopubObj->autoPublishWorkspaces();
00050             // There's no feedback from the publishing process,
00051             // so there can't be any failure.
00052             // TODO: This could certainly be improved.
00053         return TRUE;
00054     }
00055 }
00056 
00057 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/tasks/class.tx_version_tasks_autopublish.php'])) {
00058     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/tasks/class.tx_version_tasks_autopublish.php']);
00059 }
00060 ?>