summaryrefslogtreecommitdiff
path: root/framework/DataAccess/SQLMap/Configuration
diff options
context:
space:
mode:
authorwei <>2006-04-14 11:23:56 +0000
committerwei <>2006-04-14 11:23:56 +0000
commitf6a5e7589396854e10e023c25237b47e512ff047 (patch)
tree2b313bb8b66869235ee06b9cae2af2f7645cf5c9 /framework/DataAccess/SQLMap/Configuration
parent3d3f8d3832921f99daf8ce1953304763c2e76c62 (diff)
Adding SQLMap unit tests. Allow sqlmap to use Prado's caching module to cache records.
Diffstat (limited to 'framework/DataAccess/SQLMap/Configuration')
-rw-r--r--framework/DataAccess/SQLMap/Configuration/TConfigDeserialize.php4
-rw-r--r--framework/DataAccess/SQLMap/Configuration/TSqlMapCacheModel.php12
2 files changed, 8 insertions, 8 deletions
diff --git a/framework/DataAccess/SQLMap/Configuration/TConfigDeserialize.php b/framework/DataAccess/SQLMap/Configuration/TConfigDeserialize.php
index 250133b9..9a44d1ec 100644
--- a/framework/DataAccess/SQLMap/Configuration/TConfigDeserialize.php
+++ b/framework/DataAccess/SQLMap/Configuration/TConfigDeserialize.php
@@ -144,7 +144,7 @@ class TConfigDeserialize
{
$cacheModel = new TSqlMapCacheModel;
$this->loadConfiguration($cacheModel, $node, $file);
- if(isset($node->flushInterval))
+/* if(isset($node->flushInterval))
{
$interval = $node->flushInterval;
$span = 0; //span in seconds
@@ -156,7 +156,7 @@ class TConfigDeserialize
$span += intval($interval['seconds']);
if($span > 0)
$cacheModel->setFlushInterval($span);
- }
+ }*/
if(isset($node->property))
{
foreach($node->property as $property)
diff --git a/framework/DataAccess/SQLMap/Configuration/TSqlMapCacheModel.php b/framework/DataAccess/SQLMap/Configuration/TSqlMapCacheModel.php
index 6c945155..3bd20933 100644
--- a/framework/DataAccess/SQLMap/Configuration/TSqlMapCacheModel.php
+++ b/framework/DataAccess/SQLMap/Configuration/TSqlMapCacheModel.php
@@ -3,11 +3,11 @@
class TSqlMapCacheModel extends TComponent
{
private $_cache;
- private $_flushInterval = -1;
+// private $_flushInterval = -1;
private $_hits = 0;
private $_requests = 0;
private $_id;
- private $_lastFlush;
+// private $_lastFlush;
private $_implementation;
private $_properties = array();
@@ -18,15 +18,15 @@ class TSqlMapCacheModel extends TComponent
public function getImplementation(){ return $this->_implementation; }
public function setImplementation($value){ $this->_implementation = $value; }
- public function getFlushInterval(){ return $this->_flushInterval; }
- public function setFlushInterval($value){ $this->_flushInterval = $value; }
+// public function getFlushInterval(){ return $this->_flushInterval; }
+// public function setFlushInterval($value){ $this->_flushInterval = $value; }
public function initialize($sqlMap)
{
$implementation = $this->getImplementationClass(
$sqlMap->getTypeHandlerFactory());
$this->_cache = new $implementation;
- $this->_cache->configure($this->_properties);
+ $this->_cache->configure($this, $this->_properties);
}
protected function getImplementationClass($typeFactory)
@@ -35,6 +35,7 @@ class TSqlMapCacheModel extends TComponent
{
case 'fifo': return 'TSqlMapFifoCache';
case 'lru' : return 'TSqlMapLruCache';
+ case 'basic' : return 'TSqlMapApplicationCache';
}
if(class_exists($this->_implementation, false))
@@ -66,7 +67,6 @@ class TSqlMapCacheModel extends TComponent
public function flush()
{
- var_dump("flush!");
$this->_cache->flush();
}