00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 2008 Ingo Renner <ingo@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 require_once(PATH_t3lib . 'interfaces/interface.t3lib_singleton.php'); 00026 00027 /** 00028 * A cache handling helper class 00029 * 00030 * @author Ingo Renner <ingo@typo3.org> 00031 * @package TYPO3 00032 * @subpackage t3lib 00033 */ 00034 class t3lib_cache { 00035 00036 /** 00037 * initializes the cache_pages cache 00038 * 00039 * @return void 00040 * @author Ingo Renner <ingo@typo3.org> 00041 */ 00042 public static function initPageCache() { 00043 try { 00044 $GLOBALS['typo3CacheFactory']->create( 00045 'cache_pages', 00046 't3lib_cache_VariableCache', 00047 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackendAssignments']['cache_pages']['backend'], 00048 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackendAssignments']['cache_pages']['options'] 00049 ); 00050 } catch(t3lib_cache_exception_DuplicateIdentifier $e) { 00051 // do nothing, a cache_pages cache already exists 00052 } 00053 } 00054 00055 /** 00056 * initializes the cache_pagesection cache 00057 * 00058 * @return void 00059 * @author Ingo Renner <ingo@typo3.org> 00060 */ 00061 public static function initPageSectionCache() { 00062 try { 00063 $GLOBALS['typo3CacheFactory']->create( 00064 'cache_pagesection', 00065 't3lib_cache_VariableCache', 00066 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackendAssignments']['cache_pagesection']['backend'], 00067 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackendAssignments']['cache_pagesection']['options'] 00068 ); 00069 } catch(t3lib_cache_exception_DuplicateIdentifier $e) { 00070 // do nothing, a cache_pagesection cache already exists 00071 } 00072 } 00073 00074 /** 00075 * initializes the cache_hash cache 00076 * 00077 * @return void 00078 * @author Ingo Renner <ingo@typo3.org> 00079 */ 00080 public static function initContentHashCache() { 00081 try { 00082 $GLOBALS['typo3CacheFactory']->create( 00083 'cache_hash', 00084 't3lib_cache_VariableCache', 00085 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackendAssignments']['cache_hash']['backend'], 00086 $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackendAssignments']['cache_hash']['options'] 00087 ); 00088 } catch(t3lib_cache_exception_DuplicateIdentifier $e) { 00089 // do nothing, a cache_hash cache already exists 00090 } 00091 } 00092 } 00093 00094 00095 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_cache.php']) { 00096 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_cache.php']); 00097 } 00098 00099 ?>
1.4.7