[pLog-svn] r1708 - plog/branches/plog-1.1-ben/class/database

ork at devel.plogworld.net ork at devel.plogworld.net
Mon Apr 4 17:45:06 GMT 2005


Author: ork
Date: 2005-04-04 17:45:05 +0000 (Mon, 04 Apr 2005)
New Revision: 1708

Modified:
   plog/branches/plog-1.1-ben/class/database/db.class.php
Log:
call config if needed, not everytime .. 


Modified: plog/branches/plog-1.1-ben/class/database/db.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/database/db.class.php	2005-04-04 17:42:19 UTC (rev 1707)
+++ plog/branches/plog-1.1-ben/class/database/db.class.php	2005-04-04 17:45:05 UTC (rev 1708)
@@ -17,6 +17,7 @@
      */
 	class Db extends Object 
 	{
+        var $_prefix;
 
 		function Db()
 		{
@@ -70,9 +71,15 @@
 		 */
 		function getPrefix()
 		{
-			$fileConfig = new ConfigFileStorage();
-			$prefix = $fileConfig->getValue( "db_prefix" );
-			return( $prefix );	
+            static $prefix;
+
+            if ( isset($prefix) ) {
+                return $prefix;
+            } else {
+			    $fileConfig = new ConfigFileStorage();
+			    $prefix = $fileConfig->getValue( "db_prefix" );
+			    return( $prefix );	
+            }
 		}
 
 		/**




More information about the pLog-svn mailing list