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