diff options
author | xue <> | 2008-01-11 15:17:42 +0000 |
---|---|---|
committer | xue <> | 2008-01-11 15:17:42 +0000 |
commit | 10ba6d05b807d3a4a01408a4085455976d4ac89b (patch) | |
tree | 9885e23f975561a33b2859ab8bc63e873c8a3a3e /framework/Util | |
parent | d2e5d2ff88b29ef966b8e27299c1e30ba48eb623 (diff) |
TParameterModule added caching support
Diffstat (limited to 'framework/Util')
-rw-r--r-- | framework/Util/TParameterModule.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/framework/Util/TParameterModule.php b/framework/Util/TParameterModule.php index fb962db4..e63fad1d 100644 --- a/framework/Util/TParameterModule.php +++ b/framework/Util/TParameterModule.php @@ -59,8 +59,21 @@ class TParameterModule extends TModule $this->loadParameters($config);
if($this->_paramFile!==null)
{
- $dom=new TXmlDocument;
- $dom->loadFromFile($this->_paramFile);
+ if(($cache=$this->getApplication()->getCache())!==null)
+ {
+ $cacheKey='TParameterModule:'.$this->_paramFile;
+ if(($dom=$cache->get($cacheKey))===false)
+ {
+ $dom=new TXmlDocument;
+ $dom->loadFromFile($this->_paramFile);
+ $cache->set($cacheKey,$dom,0,new TFileCacheDependency($this->_paramFile));
+ }
+ }
+ else
+ {
+ $dom=new TXmlDocument;
+ $dom->loadFromFile($this->_paramFile);
+ }
$this->loadParameters($dom);
}
$this->_initialized=true;
|