X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fc40939775813705f1be2bf8a095d47b015c9982..d364afdf3ba2c3b59498325c43128005ef361720:/lib/setup/SetupClass.php diff --git a/lib/setup/SetupClass.php b/lib/setup/SetupClass.php index 56d9f345..ea47e828 100755 --- a/lib/setup/SetupClass.php +++ b/lib/setup/SetupClass.php @@ -85,7 +85,7 @@ class SetupFunctions info('Create DB'); $oDB = new \Nominatim\DB; - if ($oDB->databaseExists()) { + if ($oDB->checkConnection()) { fail('database already exists ('.CONST_Database_DSN.')'); } @@ -675,7 +675,7 @@ class SetupFunctions ); $aDropTables = array(); - $aHaveTables = $this->oDB->getCol("SELECT tablename FROM pg_tables WHERE schemaname='public'"); + $aHaveTables = $this->oDB->getListOfTables(); foreach ($aHaveTables as $sTable) { $bFound = false; @@ -694,6 +694,44 @@ class SetupFunctions $this->removeFlatnodeFile(); } + /** + * Setup settings-frontend.php in the build/website directory + * + * @return null + */ + public function setupWebsite() + { + $rOutputFile = fopen(CONST_InstallPath.'/website/settings-frontend.php', 'w'); + + fwrite($rOutputFile, "bVerbose) echo "Dropping table $sName\n"; - $this->oDB->exec('DROP TABLE IF EXISTS '.$sName.' CASCADE'); + $this->oDB->deleteTable($sName); } /**