Changeset 7842


Ignore:
Timestamp:
Apr 18, 2010, 10:56:54 PM (15 years ago)
Author:
Pieter Naber
Message:

Doesn't work offline. Can PHP function simplexml_load_file() deal with the header("Location: ...") redirect of kml.php?

Location:
trunk/src
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/config.php

    r7838 r7842  
    2929 */
    3030$config['root']                         = dirname(__FILE__);
    31 $config['root_class']           = $config['root'] . '/inc/';
     31$config['url']                          = $_SERVER['HTTP_HOST'];
     32$config['uri']                          = $_SERVER['REQUEST_URI'];
    3233$config['file_init']            = 'init.php';
    3334
     
    3536 * Placemark settings. Which icons do you want to use
    3637 */
    37 $config['node_green']   = 'http://dellphi.wirelessleiden.nl/nodemap/img/sleutelGroen.png';
    38 $config['node_orange']  = 'http://dellphi.wirelessleiden.nl/nodemap/img/sleutelOranje.png';
    39 $config['node_red']             = 'http://dellphi.wirelessleiden.nl/nodemap/img/sleutelRood.png';
     38$config['node_green']   = 'http://' . $config['url'] . $config['uri'] . '/img/sleutelGroen.png';
     39$config['node_orange']  = 'http://' . $config['url'] . $config['uri'] . '/img/sleutelOranje.png';
     40$config['node_red']             = 'http://' . $config['url'] . $config['uri'] . '/img/sleutelRood.png';
    4041$config['line_black']   = '#66000000';
    4142
     
    4546 */
    4647$config['require']                      = array();
    47 $config['require'][]            = $config['root_class'] . 'ErrorHandler.php';
    48 $config['require'][]            = $config['root_class'] . 'LogHandler.class.php';
    49 $config['require'][]            = $config['root_class'] . 'FileHandler.class.php';
    50 $config['require'][]            = $config['root_class'] . 'KMLFile.class.php';
    51 $config['require'][]            = $config['root_class'] . 'KMLNode.class.php';
    52 $config['require'][]            = $config['root_class'] . 'KMLLine.class.php';
    53 $config['require'][]            = $config['root_class'] . 'Network.class.php';
    54 $config['require'][]            = $config['root_class'] . 'NetworkList.class.php';
     48$config['require'][]            = $config['root'] . '/inc/ErrorHandler.php';
     49$config['require'][]            = $config['root'] . '/inc/LogHandler.class.php';
     50$config['require'][]            = $config['root'] . '/inc/FileHandler.class.php';
     51$config['require'][]            = $config['root'] . '/inc/KMLFile.class.php';
     52$config['require'][]            = $config['root'] . '/inc/KMLNode.class.php';
     53$config['require'][]            = $config['root'] . '/inc/KMLLine.class.php';
     54$config['require'][]            = $config['root'] . '/inc/Network.class.php';
     55$config['require'][]            = $config['root'] . '/inc/NetworkList.class.php';
    5556
    5657$config['googlekey']            = array();
     
    6263 */
    6364$time = mktime() - (mktime() % 300);
    64 $config['kml_file']                     = 'kml.php?time=' . $time;
     65$config['kml_file']                     = 'http://' . $config['url'] . $config['uri'] . '/kml.php?time=' . $time;
    6566// Should be something like:
    6667// $config['kml_file']          = $config['root'] . '/kml.php?time=%TIMESTAMP%';
  • trunk/src/inc/LogHandler.class.php

    r7803 r7842  
    118118                if ($logno <= LOG_LEVEL_MAIL) {
    119119                        global $config;
    120                         mail($config['mail'], 'Nodemap error', $errorString);
     120                        @mail($config['mail'], 'Nodemap error', $errorString);
    121121                }
    122122        }
  • trunk/src/map/inc/kmlHandler.php

    r7827 r7842  
    44{
    55        //Check if the file exists, if it does we load it. If it doesn't we exit and return an error message
    6         if (file_exists($file))
    7         {
    8                 $xml = simplexml_load_file($file);
    9         }
    10         else
    11         {
    12                 exit('Failed to open'.$file);
     6        try {
     7                $xml = simplexml_load_file(rawurlencode($file));
     8        } catch (Exception $e) {
     9                trigger_error(SYSLOG_CRIT, 'Failed to open KML file: ' . $file, __FILE__, __LINE__);
    1310        }
    1411
Note: See TracChangeset for help on using the changeset viewer.