summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--framework/Util/TParameterModule.php17
2 files changed, 16 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 563b84b9..f1052672 100644
--- a/HISTORY
+++ b/HISTORY
@@ -18,6 +18,7 @@ ENH: Added TDbCommand.queryColumn() (Qiang)
ENH: Active Record now supports implicitly declared related properties (Qiang)
ENH: Active Record now supports query criteria for implicitly declared related properties (Qiang)
ENH: TDataFieldAccessor now supports chained property access without getters. (Qiang)
+ENH: TParameterModule added caching support (Qiang)
NEW: Added TDbLogRoute (Qiang)
NEW: Added TDataRenderer and TItemDataRenderer (Qiang)
NEW: Ticket#544 - Added TXCache (Wei)
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;