mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
move creation of website scripts to setup script
Instead of creating the website wrapper scripts with cmake, they are now created when --setup-website is called. The setup of the configuration constants is directly embedded into the scripts. This means we can get rid of the separate settings-frontend.php. More importantly however, it means that it is now possible to set up multiple website directories from the same build directory.
This commit is contained in:
18
lib/lib.php
18
lib/lib.php
@@ -134,6 +134,24 @@ function addQuotes($s)
|
||||
return "'".$s."'";
|
||||
}
|
||||
|
||||
function fwriteConstDef($rFile, $sConstName, $value)
|
||||
{
|
||||
$sEscapedValue;
|
||||
|
||||
if (is_bool($value)) {
|
||||
$sEscapedValue = $value ? 'true' : 'false';
|
||||
} elseif (is_numeric($value)) {
|
||||
$sEscapedValue = strval($value);
|
||||
} elseif (!$value) {
|
||||
$sEscapedValue = 'false';
|
||||
} else {
|
||||
$sEscapedValue = addQuotes(str_replace("'", "\\'", (string)$value));
|
||||
}
|
||||
|
||||
fwrite($rFile, "@define('CONST_$sConstName', $sEscapedValue);\n");
|
||||
}
|
||||
|
||||
|
||||
function parseLatLon($sQuery)
|
||||
{
|
||||
$sFound = null;
|
||||
|
||||
Reference in New Issue
Block a user