<?php
+require('Symfony/Component/Dotenv/autoload.php');
+
+function loadSettings($sProjectDir)
+{
+ if (!$sProjectDir) {
+ $sProjectDir = getcwd();
+ }
+
+ @define('CONST_InstallDir', $sProjectDir);
+
+ $dotenv = new \Symfony\Component\Dotenv\Dotenv();
+
+ if (file_exists($sProjectDir.'/.env')) {
+ $dotenv->load($sProjectDir.'/.env');
+ }
+ $dotenv->load(CONST_DataDir.'/settings/env.defaults');
+}
+
+function getSetting($sConfName)
+{
+ return $_ENV['NOMINATIM_'.$sConfName];
+}
+
function fail($sError, $sUserError = false)
{
if (!$sUserError) $sUserError = $sError;
if ($a['importance'] != $b['importance'])
return ($a['importance'] > $b['importance']?-1:1);
- return ($a['foundorder'] < $b['foundorder']?-1:1);
+ return $a['foundorder'] <=> $b['foundorder'];
}