1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-08-09 16:16:49 +02:00

Tileserver-php now running without .htaccess "Fixes #23"

This commit is contained in:
Dalibor Janák
2014-05-19 19:47:11 +02:00
parent cba3048506
commit 08b77f4bf4

View File

@@ -242,7 +242,7 @@ class Server {
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModifiedTime) . " GMT");
header("Etag:" . $eTag);
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModifiedTime ||
trim($_SERVER['HTTP_IF_NONE_MATCH']) == $eTag) {
@trim($_SERVER['HTTP_IF_NONE_MATCH']) == $eTag) {
return TRUE;
} else {
return FALSE;
@@ -546,9 +546,9 @@ class Json extends Server {
header('Access-Control-Allow-Origin: *');
header("Content-Type:application/javascript charset=utf-8");
if ($this->callback !== 'grid') {
echo $this->callback . '(' . $this->createJson($this->layer) . ');';
echo $this->callback . '(' . $this->createJson($this->layer) . ');'; die;
} else {
echo $this->createJson($this->layer);
echo $this->createJson($this->layer); die;
}
}
@@ -1408,6 +1408,13 @@ class Router {
if (!isset($config['baseUrls'][0])) {
$config['baseUrls'][0] = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '?';
}
if (strpos($_SERVER['REQUEST_URI'], '=') != FALSE) {
$kvp = explode('=', $_SERVER['REQUEST_URI']);
$_GET['callback'] = $kvp[1];
$params[0] = 'index';
$handler_instance = new Json($params);
$handler_instance->getJson();
}
$handler_instance = new Server;
$handler_instance->getHtml();
}