Jacek Kowalski
2024-08-17 7c2d04008df30360e5d9a2a53f42d77fa10757ea
commit | author | age
b62720 1 <?php
JK 2 $sources = [
3     'bus' => [
4d8527 4         'gtfsrt' => 'http://gtfs.ztp.krakow.pl/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' => [
4d8527 15         'gtfsrt' => 'http://gtfs.ztp.krakow.pl/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     }
4d8527 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);