From 7698583a2b774b68ef1a24f87023c8385d671f9f Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Thu, 13 Jun 2019 18:55:17 +0000
Subject: [PATCH] Factor out common section out of proxy_bus.php and proxy_tram.php
---
proxy_common.php | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/proxy.php b/proxy_common.php
similarity index 94%
rename from proxy.php
rename to proxy_common.php
index e764cb6..cbc5350 100644
--- a/proxy.php
+++ b/proxy_common.php
@@ -1,4 +1,9 @@
<?php
+if(!isset($base_proxy)) {
+ echo 'This script is for inclusion only.';
+ die();
+}
+
function is_number($str) {
$str = (string)$str;
@@ -12,7 +17,6 @@
);
}
-$base_proxy = 'http://www.ttss.krakow.pl/internetservice';
$method = [
'/services/lookup/autocomplete/json' => [
'query' => function() { return TRUE; },
@@ -65,7 +69,7 @@
],
'/geoserviceDispatcher/services/vehicleinfo/vehicles' => [
'lastUpdate' => 'ctype_digit',
- 'positionType' => function($type) { return in_array($type, ['RAW', 'CORRECTED']); },
+ 'positionType' => function($type) { return in_array($type, ['CORRECTED', 'RAW']); },
'colorType' => function($type) { return in_array($type, ['ROUTE_BASED']); },
],
];
--
Gitblit v1.9.1