summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2008-01-11 15:17:42 +0000
committerxue <>2008-01-11 15:17:42 +0000
commit10ba6d05b807d3a4a01408a4085455976d4ac89b (patch)
tree9885e23f975561a33b2859ab8bc63e873c8a3a3e
parentd2e5d2ff88b29ef966b8e27299c1e30ba48eb623 (diff)
TParameterModule added caching support
-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;