Jacek Kowalski
2020-05-25 bf4b8f1aadbe87edbae34368cc10d7b6e08ecbca
commit | author | age
b62720 1 <?php
JK 2 $sources = [
3     'bus' => [
9faa03 4         'gtfsrt' => 'ftp://ztp.krakow.pl/pliki-gtfs/VehiclePositions_A.pb',
b62720 5         'gtfsrt_file' => 'VehiclePositions_A.pb',
JK 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',
413654 11         'vehicle_types' => new BusTypes(),
c077c7 12         'prefix' => 'b',
b62720 13     ],
JK 14     'tram' => [
9faa03 15         'gtfsrt' => 'ftp://ztp.krakow.pl/pliki-gtfs/VehiclePositions_T.pb',
b62720 16         'gtfsrt_file' => 'VehiclePositions_T.pb',
6a29bc 17         'ttss' => 'http://www.ttss.krakow.pl/internetservice/geoserviceDispatcher/services/vehicleinfo/vehicles?positionType=CORRECTED',
b62720 18         'ttss_file' => 'vehicles_T.json',
JK 19         'database' => 'mapping_T.sqlite3',
20         'result' => 'mapping_T.json',
c077c7 21         'result_vehicles' => 'vehicles_T.html',
413654 22         'vehicle_types' => new TramTypes(),
c077c7 23         'prefix' => 't',
b62720 24     ],
b41a44 25 ];
b62720 26
JK 27 foreach($sources as $name => &$source) {
c077c7 28     foreach(['gtfsrt_file', 'ttss_file', 'database', 'result', 'result_vehicles'] as $field) {
b62720 29         $source[$field] = __DIR__.'/data/'.$source[$field];
JK 30     }
c077c7 31     
b62720 32     $source['result_temp'] = $source['result'].'.tmp';
c077c7 33     $source['result_vehicles_temp'] = $source['result_vehicles'].'.tmp';
b62720 34 }
JK 35 unset($source);