mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
simplify connection handling in setup script
- factor out runWithEnv - require explicit connect() call to avoid rechecking for oDB (more for readability than for speed) - clean DSNInfo of empty strings and simplify check for entries
This commit is contained in:
@@ -80,6 +80,8 @@ if ($aCMDResult['create-db'] || $aCMDResult['all']) {
|
||||
$oSetup->createDB();
|
||||
}
|
||||
|
||||
$oSetup->connect();
|
||||
|
||||
if ($aCMDResult['setup-db'] || $aCMDResult['all']) {
|
||||
$bDidSomething = true;
|
||||
$oSetup->setupDB();
|
||||
|
||||
@@ -110,6 +110,7 @@ if ($aResult['init-updates']) {
|
||||
'enable-diff-updates' => true,
|
||||
'verbose' => $aResult['verbose']
|
||||
));
|
||||
$cSetup->connect();
|
||||
$cSetup->createFunctions();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user