Jacek Kowalski
2019-06-21 ea2e9b41b3b1eace8e99d6e2672ffffb07665e04
commit | author | age
b62720 1 <?php
JK 2 $sources = [
3     'bus' => [
4         'gtfsrt' => 'ftp://ztp.krakow.pl/VehiclePositions_A.pb',
5         'gtfsrt_file' => 'VehiclePositions_A.pb',
6         'ttss' => 'http://ttss.mpk.krakow.pl/internetservice/geoserviceDispatcher/services/vehicleinfo/vehicles',
7         'ttss_file' => 'vehicles_A.json',
8         'database' => 'mapping_A.sqlite3',
9         'result' => 'mapping_A.json',
10         'mapper' => 'numToTypeB',
11     ],
12     'tram' => [
13         'gtfsrt' => 'ftp://ztp.krakow.pl/VehiclePositions_T.pb',
14         'gtfsrt_file' => 'VehiclePositions_T.pb',
15         'ttss' => 'http://www.ttss.krakow.pl/internetservice/geoserviceDispatcher/services/vehicleinfo/vehicles',
16         'ttss_file' => 'vehicles_T.json',
17         'database' => 'mapping_T.sqlite3',
18         'result' => 'mapping_T.json',
19         'mapper' => 'numToTypeT',
20     ],
21     'tram2' => [
22         'gtfsrt' => 'ftp://ztp.krakow.pl/VehiclePositions.pb',
23         'gtfsrt_file' => 'VehiclePositions_T.pb',
24         'ttss' => 'http://www.ttss.krakow.pl/internetservice/geoserviceDispatcher/services/vehicleinfo/vehicles',
25         'ttss_file' => 'vehicles_T.json',
26         'database' => 'mapping_T.sqlite3',
27         'result' => 'mapping_T.json',
28         'mapper' => 'numToTypeT',
29     ],
30 ]; 
31
32 foreach($sources as $name => &$source) {
33     foreach(['gtfsrt_file', 'ttss_file', 'database', 'result'] as $field) {
34         $source[$field] = __DIR__.'/data/'.$source[$field];
35     }
36     $source['result_temp'] = $source['result'].'.tmp';
37 }
38 unset($source);