gyro/core/controller/base/cachemanager/simplecachemanager.cls.php
Go to the documentation of this file.00001 <?php 00002 require_once dirname(__FILE__) . '/constantcachemanager.cls.php'; 00003 00004 /** 00005 * Very simple cache manager. Returns the current url as cache id 00006 * 00007 * @author Gerd Riesselmann 00008 * @ingroup Controller 00009 */ 00010 class SimpleCacheManager extends ConstantCacheManager { 00011 public function __construct($duration = 7200) { 00012 $url = Url::current(); 00013 $cache_id = array(); 00014 00015 if ($url->get_host() != Config::get_value(Config::URL_DOMAIN)) { 00016 $cache_id[] = $url->get_host(); 00017 } 00018 00019 $path = $url->get_path(); 00020 if (empty($path)) { 00021 $path = '.'; 00022 } 00023 $cache_id[] = $path; 00024 $cache_id[] = $url->get_query(); 00025 parent::__construct($cache_id, $duration, CacheHeaderManagerFactory::create(Config::get_value(Config::CACHEHEADER_CLASS_CACHED))); 00026 } 00027 }