[pLog-svn] r2762 - in plog/trunk: class/config class/database config release

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Jan 8 17:43:17 GMT 2006


Author: oscar
Date: 2006-01-08 17:43:16 +0000 (Sun, 08 Jan 2006)
New Revision: 2762

Modified:
   plog/trunk/class/config/configfilestorage.class.php
   plog/trunk/class/database/db.class.php
   plog/trunk/config/config.properties.php
   plog/trunk/release/config.properties.php.dist
Log:
merged feature request 794 for optional non-persistent database connections (http://bugs.lifetype.net/view.php?id=794)


Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php	2006-01-08 17:14:13 UTC (rev 2761)
+++ plog/trunk/class/config/configfilestorage.class.php	2006-01-08 17:43:16 UTC (rev 2762)
@@ -93,6 +93,7 @@
             $config["db_username"] = "";
             $config["db_password"] = "";
             $config["db_database"] = "";
+            $config["db_persistent"] = true;
             #
             # the database prefix will be appended to the name of each database tables in case you want
             # to have more than one version of plog running at the same time, such as the stable and

Modified: plog/trunk/class/database/db.class.php
===================================================================
--- plog/trunk/class/database/db.class.php	2006-01-08 17:14:13 UTC (rev 2761)
+++ plog/trunk/class/database/db.class.php	2006-01-08 17:43:16 UTC (rev 2762)
@@ -39,12 +39,19 @@
                 $password = $fileConfig->getValue( "db_password" );
                 $host     = $fileConfig->getValue( "db_host" );
                 $dbname   = $fileConfig->getValue( "db_database" );
-
+                $dbpersistent   = $fileConfig->getValue( "db_persistent" );
+              if($dbpersistent == true) {
             	if( !$db->PConnect( $host, $username, $password, $dbname )) {
             		throw( new Exception( "Fatal error: could not connect to the database!" ));
                 	die();
             	}
-            	
+            	}
+            	else {
+	            	if( !$db->Connect( $host, $username, $password, $dbname )) {
+	            		throw( new Exception( "Fatal error: could not connect to the database!" ));
+	                	die();
+	            	}
+            	}
 	           	// just in case, forcing to use indexing by field name instead of
     	       	// by field number
         	   	//$db->SetFetchMode( ADODB_FETCH_ASSOC );       	

Modified: plog/trunk/config/config.properties.php
===================================================================
--- plog/trunk/config/config.properties.php	2006-01-08 17:14:13 UTC (rev 2761)
+++ plog/trunk/config/config.properties.php	2006-01-08 17:43:16 UTC (rev 2762)
@@ -31,3 +31,4 @@
 $config["db_password"] = "";
 $config["db_database"] = "";
 $config["db_prefix"] = "";
+$config["db_persistent"] = true;

Modified: plog/trunk/release/config.properties.php.dist
===================================================================
--- plog/trunk/release/config.properties.php.dist	2006-01-08 17:14:13 UTC (rev 2761)
+++ plog/trunk/release/config.properties.php.dist	2006-01-08 17:43:16 UTC (rev 2762)
@@ -6,6 +6,7 @@
 $config["db_username"] = "";
 $config["db_password"] = "";
 $config["db_database"] = "";
+$config["db_persistent"] = true;
 #
 # the database prefix will be appended to the name of each database tables in case you want
 # to have more than one version of plog running at the same time, such as the stable and



More information about the pLog-svn mailing list