Jacek Kowalski
2020-07-14 96c5f5f3abd1f4af6e51e33f91b32b89b7661153
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 }