Jacek Kowalski
2019-06-30 75471ecd99d1b3583a2c87dd71b56a72358de4f2
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 }