commit | author | age
|
ea2e9b
|
1 |
<?php |
JK |
2 |
require_once(__DIR__.'/vendor/autoload.php'); |
|
3 |
require_once(__DIR__.'/config.php'); |
|
4 |
|
|
5 |
foreach($sources as $name => $source) { |
|
6 |
$logger = new Monolog\Logger('regenerate_'.$name); |
|
7 |
try { |
|
8 |
$logger->info('Regenerating '.$name.'...'); |
|
9 |
$db = new Database($source['database']); |
413654
|
10 |
$mapper = new Mapper(); |
JK |
11 |
$mapper->loadTTSS($source['ttss_file']); |
|
12 |
$output = new Output($db, $mapper, $source['vehicle_types']); |
|
13 |
$fullMapping = $output->createMapping($source); |
|
14 |
$output->createVehiclesList($fullMapping, $source); |
ea2e9b
|
15 |
$logger->info('Finished'); |
JK |
16 |
} catch(Throwable $e) { |
|
17 |
$logger->error($e->getMessage(), ['exception' => $e, 'exception_string' => (string)$e]); |
|
18 |
} |
|
19 |
} |