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