[pLog-svn] r4777 - plog/branches/lifetype-1.2/class/config

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Feb 18 16:51:01 EST 2007


Author: oscar
Date: 2007-02-18 16:51:01 -0500 (Sun, 18 Feb 2007)
New Revision: 4777

Modified:
   plog/branches/lifetype-1.2/class/config/configdbstorage.class.php
Log:
minor optimization, the previous approach didn't make too much sense to me.


Modified: plog/branches/lifetype-1.2/class/config/configdbstorage.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/config/configdbstorage.class.php	2007-02-18 21:25:23 UTC (rev 4776)
+++ plog/branches/lifetype-1.2/class/config/configdbstorage.class.php	2007-02-18 21:51:01 UTC (rev 4777)
@@ -127,18 +127,11 @@
 		 */
         function getValue( $key, $defaultValue = null )
         {
-            if (!is_object( $this->_cache )) {
-                $this->_cache =& CacheManager::getCache();
-            }
-            if($this->_data == array()) {
-                $data = $this->_data = $this->_cache->getData( CACHE_CONFIGDBSTORAGE, CACHE_GLOBAL );
-                if ($data) {
-                    $this->_data = $data;
-                } else {
-                    $this->_loadAllValuesFromDatabase();
-                }
-            }
-
+			if( (!$this->_data = $this->_cache->getData( CACHE_CONFIGDBSTORAGE, CACHE_GLOBAL ))) {
+				print("data not in cache!");
+				$this->_loadAllValuesFromDatabase();				
+			}
+			
             if( array_key_exists($key, $this->_data) ) {
                 if ($this->_data[$key] == "" || $this->_data[$key] == null) {
                     return $defaultValue;



More information about the pLog-svn mailing list