浏览代码

ZF-7042
- Zend_Db_Table_Abstract::_setupMetadata() fixed to include port/host & dbname in cacheId creation

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@17819 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 16 年之前
父节点
当前提交
27a863a692
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      library/Zend/Db/Table/Abstract.php

+ 10 - 1
library/Zend/Db/Table/Abstract.php

@@ -803,7 +803,16 @@ abstract class Zend_Db_Table_Abstract
         // If $this has a metadata cache
         if (null !== $this->_metadataCache) {
             // Define the cache identifier where the metadata are saved
-            $cacheId = md5("$this->_schema.$this->_name");
+            
+            //get db configuration
+            $dbConfig = $this->_db->getConfig();
+                
+            // Define the cache identifier where the metadata are saved
+            $cacheId = md5( // port:host/dbname:schema.table (based on availabilty)
+                (isset($dbConfig['options']['port']) ? ':'.$dbConfig['options']['port'] : null)
+                . (isset($dbConfig['options']['host']) ? ':'.$dbConfig['options']['host'] : null)
+                . '/'.$dbConfig['dbname'].':'.$this->_schema.'.'.$this->_name
+                );
         }
 
         // If $this has no metadata cache or metadata cache misses