$defMap = [ 'https://a.tile.openstreetmap.org/', 'https://b.tile.openstreetmap.org/', 'https://b.tile.openstreetmap.de/', 'http://tile.thunderforest.com/cycle/', 'http://tile.thunderforest.com/transport/', 'http://tile.thunderforest.com/landscape/', 'http://tile.memomaps.de/tilegen/', 'https://tiles.wmflabs.org/hikebike/', 'http://tile.stamen.com/toner/', 'http://tile.stamen.com/toner-hybrid/', 'http://tile.stamen.com/toner-labels/', 'http://tile.stamen.com/toner-lines/', 'http://tile.stamen.com/toner-background/', 'http://tile.stamen.com/toner-lite/' // "https://stamen-tiles.a.ssl.fastly.net/toner/" ]; $defLatLon = [ 50.0740, 14.4505 ]; $defZoom = 10; // ---------------------- log proxy ------------------------------------------ $O_local = false; if ( $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1' || strstr ($_SERVER['SERVER_NAME'], '10.0.0.') ) { $O_local = true; ini_set("log_errors", 1); ini_set("error_log", "/tmp/php-error.log"); } else { ini_set("log_errors", 1); ini_set("error_log", "../MYLOG/.php-error.log"); } function myLog( $message, $var = '' ){ global $globalPHPFile; if ( is_array($var) ) $var = print_r( $var, true ); error_log( '[' . urldecode(getenv('REQUEST_URI')) . '][' . basename($globalPHPFile, '.php') . '] ' . $message . $var ); } if ( !isset ($_POST[ 'session_test' ]) ) { myLog( "----------- MAIN -------------" ); myLog('REQUEST_URI MAIN: ' . $_SERVER['SERVER_NAME']); } ini_set('session.cookie_domain', $_SERVER['SERVER_NAME']); //------------------------------ url parsing --------------------------------- $urlLine = explode('?', rtrim( getenv('REQUEST_URI') , '/') ); $url = explode('/', $urlLine[0] ); if ( !empty($url[1]) ) $mapNum = $url[1]; else $mapNum = 0; if ( !empty($url[2]) ) $targetLocation = '/maps/' . "$url[2]|$url[3]|$url[4]|$url[5]" . '/'; else $targetLocation = $defMap[ $mapNum ]; if ( !empty($url[3]) && !empty($url[4]) ) $targetLatLon = [ $url[3], $url[4] ]; else $targetLatLon = $defLatLon; if ( !empty($url[5]) ) $targetZoom = $url[5]; else $targetZoom = $defZoom; myLog('$targetLocation: ', $targetLocation); myLog('$mapNum: ', $mapNum); // --------------------------------------------------------------------------- exec("ls 'maps/'", $mapList ); // --------------------------------------------------------------------------- ?>