[Fusionforge-commits] r13750 - trunk/src/common/include

Franck VILLAUME nerville at fusionforge.org
Tue Jul 12 13:01:31 CEST 2011


Author: nerville
Date: 2011-07-12 13:01:31 +0200 (Tue, 12 Jul 2011)
New Revision: 13750

Modified:
   trunk/src/common/include/database-pgsql.php
Log:
cleanup: coding rule

Modified: trunk/src/common/include/database-pgsql.php
===================================================================
--- trunk/src/common/include/database-pgsql.php	2011-07-12 08:24:35 UTC (rev 13749)
+++ trunk/src/common/include/database-pgsql.php	2011-07-12 11:01:31 UTC (rev 13750)
@@ -114,28 +114,33 @@
         }
 }
 
-function db_switcher($dbserver=NULL) {
+function db_switcher($dbserver = NULL) {
 	switch ($dbserver) {
-	case NULL:
-	case 'SYS_DB_PRIMARY':
-		$dbconn = SYS_DB_PRIMARY ;
-		break ;
-	case 'SYS_DB_STATS':
-		$dbconn = SYS_DB_STATS ;
-		break ;
-	case 'SYS_DB_TROVE':
-		$dbconn = SYS_DB_TROVE ;
-		break ;
-	case 'SYS_DB_SEARCH':
-		$dbconn = SYS_DB_SEARCH ;
-		break ;
-	default:
-		// Cope with $dbserver already being a connection
-		if (pg_dbname($dbserver)) {
-			$dbconn = $dbserver;
-		} else {
-			$dbconn = SYS_DB_PRIMARY ;
+		case NULL:
+		case 'SYS_DB_PRIMARY': {
+			$dbconn = SYS_DB_PRIMARY;
+			break;
 		}
+		case 'SYS_DB_STATS': {
+			$dbconn = SYS_DB_STATS;
+			break;
+		}
+		case 'SYS_DB_TROVE': {
+			$dbconn = SYS_DB_TROVE;
+			break;
+		}
+		case 'SYS_DB_SEARCH': {
+			$dbconn = SYS_DB_SEARCH;
+			break;
+		}
+		default: {
+			// Cope with $dbserver already being a connection
+			if (pg_dbname($dbserver)) {
+				$dbconn = $dbserver;
+			} else {
+				$dbconn = SYS_DB_PRIMARY;
+			}
+		}
 	}
 
 	return $dbconn;




More information about the Fusionforge-commits mailing list