[Mapbender-commits] r3402 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 5 05:30:08 EST 2009


Author: christoph
Date: 2009-01-05 05:30:08 -0500 (Mon, 05 Jan 2009)
New Revision: 3402

Modified:
   trunk/mapbender/http/classes/class_bbox.php
   trunk/mapbender/http/classes/class_point.php
Log:
http://trac.osgeo.org/mapbender/ticket/361

Modified: trunk/mapbender/http/classes/class_bbox.php
===================================================================
--- trunk/mapbender/http/classes/class_bbox.php	2009-01-05 10:02:07 UTC (rev 3401)
+++ trunk/mapbender/http/classes/class_bbox.php	2009-01-05 10:30:08 UTC (rev 3402)
@@ -31,7 +31,23 @@
 	/**
 	 * @constructor
 	 */
-	function __construct($param0, $param1, $param2, $param3, $param4) {
+	function __construct() {
+		if (func_num_args() == 5) {
+			$param0 = func_get_arg(0);
+			$param1 = func_get_arg(1);
+			$param2 = func_get_arg(2);
+			$param3 = func_get_arg(3);
+			$param4 = func_get_arg(4);
+		}
+		else if (func_num_args() == 3) {
+			$param0 = func_get_arg(0);
+			$param1 = func_get_arg(1);
+			$param2 = func_get_arg(2);
+		}
+		else {
+			return;
+		}
+		
 		// params are point, point, epsg
 		if (is_a($param0, "Mapbender_point") && is_a($param1, "Mapbender_point") && !$param3 && !$param4) {
 			$e = new mb_notice("Mapbender_bbox: constructor: point1, point2, epsg");

Modified: trunk/mapbender/http/classes/class_point.php
===================================================================
--- trunk/mapbender/http/classes/class_point.php	2009-01-05 10:02:07 UTC (rev 3401)
+++ trunk/mapbender/http/classes/class_point.php	2009-01-05 10:30:08 UTC (rev 3402)
@@ -31,13 +31,23 @@
 	/**
 	 * @constructor
 	 */
-	function __construct($x, $y, $z, $epsg) {
-		// may be called without $z; so $epsg is the third parameter, $z
-		if (isset($x) && isset($y) && isset($z) && !isset($epsg)) {
-			$e = new mb_notice("Mapbender_point: constructor: probably 2d call (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
-			$epsg = $z;
+	function __construct() {
+		if (func_num_args() == 4) {
+			$x = func_get_arg(0);
+			$y = func_get_arg(1);
+			$z = func_get_arg(2);
+			$epsg = func_get_arg(3);
+		}
+		else if (func_num_args() == 3) {
+			$x = func_get_arg(0);
+			$y = func_get_arg(1);
 			$z = false;
+			$epsg = func_get_arg(2);
 		}
+		else {
+			return;
+		}
+
 		if (!isset($x) || !isset($y) || !isset($epsg)) {
 			$e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
 		}



More information about the Mapbender_commits mailing list