[Mapbender-commits] r3242 - in trunk/mapbender/http: classes tools
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Nov 19 03:50:40 EST 2008
Author: christoph
Date: 2008-11-19 03:50:39 -0500 (Wed, 19 Nov 2008)
New Revision: 3242
Modified:
trunk/mapbender/http/classes/class_json.php
trunk/mapbender/http/tools/mapbender_setup.php
Log:
http://trac.osgeo.org/mapbender/ticket/326
Modified: trunk/mapbender/http/classes/class_json.php
===================================================================
--- trunk/mapbender/http/classes/class_json.php 2008-11-19 08:48:16 UTC (rev 3241)
+++ trunk/mapbender/http/classes/class_json.php 2008-11-19 08:50:39 UTC (rev 3242)
@@ -40,6 +40,16 @@
private $library = JSON_PEAR;
/**
+ * Check whether Mapbender will use the native PHP JSON functions
+ * or the PEAR library
+ *
+ * @return Boolean
+ */
+ public static function usesNative () {
+ return function_exists("json_encode");
+ }
+
+ /**
* Determines which JSON lib to use.
* @constructor
*/
Modified: trunk/mapbender/http/tools/mapbender_setup.php
===================================================================
--- trunk/mapbender/http/tools/mapbender_setup.php 2008-11-19 08:48:16 UTC (rev 3241)
+++ trunk/mapbender/http/tools/mapbender_setup.php 2008-11-19 08:50:39 UTC (rev 3242)
@@ -22,6 +22,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -57,7 +58,7 @@
if (phpversion()<'5.2.0') $check .="<td width=\"10\"></td><td><font color=#0000FF>Version: " . phpversion() . "! You should think about upgrade to the current php version (get it <a href='http://www.php.net/downloads.php' target='_blank'>here</a>)</td></tr>";
else $check .="<td width=\"10\">X</td><td><font color=#00D000>Version: " . phpversion() . "</td></tr>";
}
- else $check .="<td width=\"10\"></td><td><font color=#FF0000>Version: " . phpversion() . "! Your PHP Version is very old, please upgrade to version >=5.1.0 to use full mapbender functionality and reduce problems!</td></tr>";
+ else $check .="<td width=\"10\"></td><td><font color=#FF0000>Version: " . phpversion() . "! Your PHP Version is very old, please upgrade to version >=5.1.0 to use full mapbender functionality and reduce problems! PHP >= 5.2 is recommended.</td></tr>";
#php-schnittstelle
if(php_sapi_name() == 'cgi') $check.="<tr><td >interface</td><td>X</td><td><font color=#00D000>CGI-PHP</td></tr>";
else $check.="<tr><td >interface</td><td>X</td><td><font color=#00D000>Modul-PHP</td></tr>";
@@ -97,6 +98,10 @@
$check .="<tr ><td>short_open_tag</td>";
if (get_cfg_var('short_open_tag')!='1') $check .= "<td>X</td><td><font color=#00D000>Off</font></td></tr>";
else $check .= "<td></td><td><font color=#FF0000>On => Displaying XML files will not work properly</font></td></tr>";
+# json
+ $check .="<tr ><td>JSON support</td>";
+ if (Mapbender_JSON::usesNative()) $check .= "<td>X</td><td><font color=#00D000>Native PHP</font></td></tr>";
+ else $check .= "<td></td><td><font color=#FF0000>PEAR library, think about uprading to PHP >=5.2 </font><font color=#0000FF>(the library is error prone with huge data sets; some things like WMC load/save might not work properly)</font></td></tr>";
echo $check;
#################################################
#PHP Extensioncheck
@@ -252,7 +257,7 @@
}
else $check .="<tr><td>AUTO_UPDATE</td><td></td><td><font color=#FF0000>AUTO_UPDATE not defined </font><font color=#0000FF>(for the wms monitoring functionality you have to define this constant)</font></td></tr>";
# ERROR LOGGING
- $testLog = new mb_notice("This is a test run by the Mapbender setup script.");
+ $testLog = new mb_exception("This is a test run by the Mapbender setup script.");
if ($testLog->result) {
$check .="<tr><td>ERROR LOGGING</td><td>X</td><td><font color=#00D000>" . $testLog->message . "</font></td></tr>";
}
More information about the Mapbender_commits
mailing list