[Mapbender-commits] r1392 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed May 30 09:53:41 EDT 2007


Author: astrid_emde
Date: 2007-05-30 09:53:41 -0400 (Wed, 30 May 2007)
New Revision: 1392

Modified:
   trunk/mapbender/http/php/database-mysql.php
Log:
handle port from mapbender.conf

Modified: trunk/mapbender/http/php/database-mysql.php
===================================================================
--- trunk/mapbender/http/php/database-mysql.php	2007-05-30 13:46:21 UTC (rev 1391)
+++ trunk/mapbender/http/php/database-mysql.php	2007-05-30 13:53:41 UTC (rev 1392)
@@ -61,17 +61,25 @@
 function db_escape_string($unescaped_string){
 	return @mysql_escape_string($unescaped_string);
 }
+
+
 function db_connect($DBSERVER="",$OWNER="",$PW="") {
 	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,
 		$conn,$conn_update,$sys_db_use_replication,$sys_dbreadhost;
 
-
+	
 	if ($DBSERVER)
 		$sys_dbhost = $DBSERVER; 
 	if ($OWNER)
 		$sys_dbuser = $OWNER; 
 	if ($PW)
 		$sys_dbpasswd = $PW; 
+	if (PORT!=''){
+		$sys_dbport = ':'.PORT;
+	}
+	else{
+		$sys_dbport = '';
+	} 
 		
 	if ($sys_db_use_replication) {
 		//
@@ -81,8 +89,8 @@
 		$conn = @mysql_pconnect($sys_dbreadhost,$sys_dbuser,$sys_dbpasswd);
 		$conn_update=@mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
 	} else {
-		$conn = @mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
-//		echo "@mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd)";
+		$conn = @mysql_pconnect($sys_dbhost.$sys_dbport,$sys_dbuser,$sys_dbpasswd);
+		echo "@mysql_pconnect($sys_dbhost.$sys_dbport,$sys_dbuser,$sys_dbpasswd)";
 	}
 	if ($sys_dbname)
 		@mysql_select_db($sys_dbname);



More information about the Mapbender_commits mailing list