[Mapbender-commits] r7628 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sat Feb 19 04:26:44 EST 2011
Author: armin11
Date: 2011-02-19 01:26:43 -0800 (Sat, 19 Feb 2011)
New Revision: 7628
Modified:
trunk/mapbender/http/classes/class_weldMaps2JPEG.php
trunk/mapbender/http/classes/class_wmc.php
Log:
set no fatal php exceptions to notice
Modified: trunk/mapbender/http/classes/class_weldMaps2JPEG.php
===================================================================
--- trunk/mapbender/http/classes/class_weldMaps2JPEG.php 2011-02-18 19:59:19 UTC (rev 7627)
+++ trunk/mapbender/http/classes/class_weldMaps2JPEG.php 2011-02-19 09:26:43 UTC (rev 7628)
@@ -34,6 +34,7 @@
$e = new mb_exception("weldMaps2JPEG: no maprequests delivered");
}
$url = explode("___", $urls);
+
$obj1 = new stripRequest($url[0]);
$width = $obj1->get("width");
$height = $obj1->get("height");
@@ -43,18 +44,19 @@
ImageFilledRectangle($image,0,0,$width,$height,$white);
for($i=0; $i<count($url); $i++){
- $obj = new stripRequest($url[$i]);
-
- $url[$i] = $obj->setPNG();
- $url[$i] = $obj->encodeGET($encode);
- $img = $this->loadpng($url[$i]);
- if($img != false){
- imagecopy($image, $img, 0, 0, 0, 0, $width, $height);
- @imagedestroy($img);
+ if ($url[$i] != false) { //sometimes some false urls will be send? - don't use them
+ $obj = new stripRequest($url[$i]);
+ $url[$i] = $obj->setPNG();
+ $url[$i] = $obj->encodeGET($encode);
+ $img = $this->loadpng($url[$i]);
+ if($img != false){
+ imagecopy($image, $img, 0, 0, 0, 0, $width, $height);
+ @imagedestroy($img);
+ }
+ else{
+ $e = new mb_exception("weldMaps2JPEG: unable to load image: " . $url[$i]);
+ }
}
- else{
- $e = new mb_exception("weldMaps2JPEG: unable to load image: " . $url[$i]);
- }
}
imagejpeg($image,$filename);
imagedestroy($image);
Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php 2011-02-18 19:59:19 UTC (rev 7627)
+++ trunk/mapbender/http/classes/class_wmc.php 2011-02-19 09:26:43 UTC (rev 7628)
@@ -666,19 +666,24 @@
db_prep_query($delkwsql, $delkwv,$delkwt);
}
else {
+ $sql = "SELECT max(wmc_serial_id) AS i FROM mb_user_wmc";
+ $res = db_query($sql);
+ $row = db_fetch_assoc($res);
+ $wmc_DB_ID_new = intval($row["i"])+1;
+
$sql = "INSERT INTO mb_user_wmc (" .
"wmc_id, fkey_user_id, wmc, wmc_title, wmc_public, wmc_timestamp, wmc_timestamp_create, " .
- "abstract, srs, minx, miny, maxx, maxy ".
- ") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13);";
+ "abstract, srs, minx, miny, maxx, maxy, wmc_serial_id".
+ ") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14);";
$v = array(time(), $this->userId, $this->xml, administration::convertOutgoingString($this->wmc_title), $this->isPublic()?1:0,time(),time(),
- $this->wmc_abstract, $this->wmc_srs, $this->wmc_extent->minx, $this->wmc_extent->miny, $this->wmc_extent->maxx, $this->wmc_extent->maxy);
- $t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i");
+ $this->wmc_abstract, $this->wmc_srs, $this->wmc_extent->minx, $this->wmc_extent->miny, $this->wmc_extent->maxx, $this->wmc_extent->maxy, $wmc_DB_ID_new);
+ $t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i", "i");
$res = db_prep_query($sql, $v, $t);
- $sql = "SELECT max(wmc_serial_id) AS i FROM mb_user_wmc";
- $res = db_query($sql);
- $row = db_fetch_assoc($res);
- $wmc_DB_ID = intval($row["i"]);
+ //$sql = "SELECT max(wmc_serial_id) AS i FROM mb_user_wmc";
+ //$res = db_query($sql);
+ //$row = db_fetch_assoc($res);
+ //$wmc_DB_ID = intval($row["i"]);
}
}
//if overwrite = false
@@ -692,7 +697,7 @@
"wmc_id, fkey_user_id, wmc, wmc_title, wmc_public, wmc_timestamp, wmc_timestamp_create, " .
"abstract, srs, minx, miny, maxx, maxy, wmc_serial_id".
") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14);";
- $e = new mb_exception($sql);
+ //$e = new mb_exception($sql);
$v = array(time(), $this->userId, $this->xml, administration::convertOutgoingString($this->wmc_title), $this->isPublic()?1:0, time(),time(),
$this->wmc_abstract, $this->wmc_srs, $this->wmc_extent->minx, $this->wmc_extent->miny, $this->wmc_extent->maxx, $this->wmc_extent->maxy, $wmc_DB_ID_new);
$t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i", "i");
@@ -944,10 +949,10 @@
$res = db_prep_query($sql,$v,$t);
$row = db_fetch_array($res);
if (isset($row['wmc_serial_id']) && $row['wmc_serial_id'] != '') {
- $e = new mb_exception("class_wmc: isPublic is true");
+ $e = new mb_notice("class_wmc: isPublic is true");
return true;
}
- $e = new mb_exception("class_wmc: isPublic is false");
+ $e = new mb_notice("class_wmc: isPublic is false");
return false;
}
More information about the Mapbender_commits
mailing list