From d833d2766f28f927cb4e1e8e660771361abdfdf9 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 17 Nov 2005 19:21:21 +0000 Subject: added application mode support. --- framework/Web/Services/TPageService.php | 40 ++------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'framework/Web/Services') diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 6c690046..bc921c0e 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -55,10 +55,6 @@ class TPageService extends TComponent implements IService * @var array list of initial page property values */ private $_properties; - /** - * @var integer cache expiration - */ - private $_cacheExpire=-1; /** * @var boolean whether service is initialized */ @@ -100,7 +96,7 @@ class TPageService extends TComponent implements IService if(is_array($arr)) { list($pageConfig,$timestamp)=$arr; - if($this->_cacheExpire<0) + if($application->getMode()!=='Performance') { // check to see if cache is the latest $paths=explode('.',$this->_pagePath); @@ -126,7 +122,7 @@ class TPageService extends TComponent implements IService $pageConfig=new TPageConfiguration; $pageConfig->loadXmlElement($config,dirname($application->getConfigurationFile()),null); $pageConfig->loadConfigurationFiles($this->_pagePath,$basePath); - $cache->set(self::CONFIG_CACHE_PREFIX.$this->_pagePath,array($pageConfig,time()),$this->_cacheExpire<0?0:$this->_cacheExpire); + $cache->set(self::CONFIG_CACHE_PREFIX.$this->_pagePath,array($pageConfig,time())); } } @@ -218,38 +214,6 @@ class TPageService extends TComponent implements IService return $this->_pagePath===$pagePath; } - /** - * @return integer the expiration time of the configuration saved in cache, - * -1 (default) ensures the cached configuration always catches up the latest configuration files, - * 0 means never expire, - * a number less or equal than 60*60*24*30 means the number of seconds that the value will remain valid. - * a number greater than 60 means a UNIX timestamp after which the value will expire. - */ - public function getCacheExpire() - { - return $this->_cacheExpire; - } - - /** - * Sets the expiration time of the configuration saved in cache. - * TPageService will try to use cache to save parsed configuration files. - * CacheExpire is used to control the caching policy. - * If you have changed this property, make sure to clean up cache first. - * @param integer the expiration time of the configuration saved in cache, - * -1 (default) ensures the cached configuration always catches up the latest configuration files, - * 0 means never expire, - * a number less or equal than 60*60*24*30 means the number of seconds that the value will remain valid. - * a number greater than 60 means a UNIX timestamp after which the value will expire. - * @throws TInvalidOperationException if the service is already initialized - */ - public function setCacheExpire($value) - { - if($this->_initialized) - throw new TInvalidOperationException('pageservice_cacheexpire_unchangeable'); - else - $this->_cacheExpire=TPropertyValue::ensureInteger($value); - } - /** * @return string default page path to be served if no explicit page is request */ -- cgit v1.2.3