Jacek Kowalski
2019-06-22 3c86810a389fb40a6f3b472915a6b6912a77279b
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',
c077c7 10         'result_vehicles' => 'vehicles_A.html',
b62720 11         'mapper' => 'numToTypeB',
c077c7 12         'prefix' => 'b',
b62720 13     ],
JK 14     'tram' => [
15         'gtfsrt' => 'ftp://ztp.krakow.pl/VehiclePositions_T.pb',
16         'gtfsrt_file' => 'VehiclePositions_T.pb',
17         'ttss' => 'http://www.ttss.krakow.pl/internetservice/geoserviceDispatcher/services/vehicleinfo/vehicles',
18         'ttss_file' => 'vehicles_T.json',
19         'database' => 'mapping_T.sqlite3',
20         'result' => 'mapping_T.json',
c077c7 21         'result_vehicles' => 'vehicles_T.html',
b62720 22         'mapper' => 'numToTypeT',
c077c7 23         'prefix' => 't',
b62720 24     ],
JK 25     'tram2' => [
26         'gtfsrt' => 'ftp://ztp.krakow.pl/VehiclePositions.pb',
27         'gtfsrt_file' => 'VehiclePositions_T.pb',
28         'ttss' => 'http://www.ttss.krakow.pl/internetservice/geoserviceDispatcher/services/vehicleinfo/vehicles',
29         'ttss_file' => 'vehicles_T.json',
30         'database' => 'mapping_T.sqlite3',
31         'result' => 'mapping_T.json',
c077c7 32         'result_vehicles' => 'vehicles_T.html',
b62720 33         'mapper' => 'numToTypeT',
c077c7 34         'prefix' => 't',
b62720 35     ],
JK 36 ]; 
37
38 foreach($sources as $name => &$source) {
c077c7 39     foreach(['gtfsrt_file', 'ttss_file', 'database', 'result', 'result_vehicles'] as $field) {
b62720 40         $source[$field] = __DIR__.'/data/'.$source[$field];
JK 41     }
c077c7 42     
b62720 43     $source['result_temp'] = $source['result'].'.tmp';
c077c7 44     $source['result_vehicles_temp'] = $source['result_vehicles'].'.tmp';
b62720 45 }
JK 46 unset($source);