[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <21-Feb-2005 16:53:31 ks> 4 // 5 // SOFTWARE NAME: eZ publish 6 // SOFTWARE RELEASE: 3.9.0 7 // BUILD VERSION: 17785 8 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 9 // SOFTWARE LICENSE: GNU General Public License v2.0 10 // NOTICE: > 11 // This program is free software; you can redistribute it and/or 12 // modify it under the terms of version 2.0 of the GNU General 13 // Public License as published by the Free Software Foundation. 14 // 15 // This program is distributed in the hope that it will be useful, 16 // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 // GNU General Public License for more details. 19 // 20 // You should have received a copy of version 2.0 of the GNU General 21 // Public License along with this program; if not, write to the Free 22 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 // MA 02110-1301, USA. 24 // 25 // 26 27 $http =& eZHTTPTool::instance(); 28 $module =& $Params["Module"]; 29 30 include_once ( 'kernel/classes/ezcache.php' ); 31 include_once ( 'lib/ezutils/classes/ezhttptool.php' ); 32 include_once ( 'kernel/classes/ezpreferences.php' ); 33 34 $cacheType = $module->actionParameter( 'CacheType' ); 35 36 eZPreferences::setValue( 'admin_clearcache_type', $cacheType ); 37 38 if ( $module->hasActionParameter ( 'NodeID' ) ) 39 $nodeID = $module->actionParameter( 'NodeID' ); 40 41 if ( $module->hasActionParameter ( 'ObjectID' ) ) 42 $objectID = $module->actionParameter( 'ObjectID' ); 43 44 if ( $cacheType == 'All' ) 45 { 46 eZCache::clearAll(); 47 } 48 elseif ( $cacheType == 'Template' ) 49 { 50 eZCache::clearByTag( 'template' ); 51 } 52 elseif ( $cacheType == 'Content' ) 53 { 54 eZCache::clearByTag( 'content' ); 55 } 56 elseif ( $cacheType == 'TemplateContent' ) 57 { 58 eZCache::clearByTag( 'template' ); 59 eZCache::clearByTag( 'content' ); 60 } 61 elseif ( $cacheType == 'Ini' ) 62 { 63 eZCache::clearByTag( 'ini' ); 64 } 65 elseif ( $cacheType == 'Static' ) 66 { 67 include_once ( 'kernel/classes/ezstaticcache.php' ); 68 69 $staticCache = new eZStaticCache(); 70 $staticCache->generateCache( true, true ); 71 $cacheCleared['static'] = true; 72 } 73 elseif ( $cacheType == 'ContentNode' ) 74 { 75 $contentModule = eZModule::exists( 'content' ); 76 if ( get_class( $contentModule ) == "ezmodule" ) 77 { 78 $contentModule->setCurrentAction( 'ClearViewCache', 'action' ); 79 80 $contentModule->setActionParameter( 'NodeID', $nodeID, 'action' ); 81 $contentModule->setActionParameter( 'ObjectID', $objectID, 'action' ); 82 83 $contentModule->run( 'action', array( $nodeID, $objectID) ); 84 } 85 } 86 elseif ( $cacheType == 'ContentSubtree' ) 87 { 88 $contentModule = eZModule::exists( 'content' ); 89 if ( get_class( $contentModule ) == "ezmodule" ) 90 { 91 $contentModule->setCurrentAction( 'ClearViewCacheSubtree', 'action' ); 92 93 $contentModule->setActionParameter( 'NodeID', $nodeID, 'action' ); 94 $contentModule->setActionParameter( 'ObjectID', $objectID, 'action' ); 95 96 $contentModule->run( 'action', array( $nodeID, $objectID) ); 97 } 98 } 99 100 $uri = $http->sessionVariable( "LastAccessedModifyingURI" ); 101 $module->redirectTo( $uri ); 102 103 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |