mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 05:18:00 +00:00
move dotenv parsing to installed PHP scripts
This means that the php-symfony-dotenv library is now only needed when using the legacy scripts. This includes the BDD tests which currently still rely on the PHP utils.
This commit is contained in:
13
lib/dotenv_loader.php
Normal file
13
lib/dotenv_loader.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
require('Symfony/Component/Dotenv/autoload.php');
|
||||
|
||||
function loadDotEnv()
|
||||
{
|
||||
$dotenv = new \Symfony\Component\Dotenv\Dotenv();
|
||||
$dotenv->load(CONST_DataDir.'/settings/env.defaults');
|
||||
|
||||
if (file_exists('.env')) {
|
||||
$dotenv->load('.env');
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require('Symfony/Component/Dotenv/autoload.php');
|
||||
|
||||
function loadSettings($sProjectDir)
|
||||
{
|
||||
@define('CONST_InstallDir', $sProjectDir);
|
||||
@@ -10,13 +8,6 @@ function loadSettings($sProjectDir)
|
||||
// set of settings.
|
||||
defined('CONST_DataDir') or define('CONST_DataDir', $_SERVER['NOMINATIM_DATADIR']);
|
||||
defined('CONST_BinDir') or define('CONST_BinDir', $_SERVER['NOMINATIM_BINDIR']);
|
||||
|
||||
$dotenv = new \Symfony\Component\Dotenv\Dotenv();
|
||||
$dotenv->load(CONST_DataDir.'/settings/env.defaults');
|
||||
|
||||
if (file_exists($sProjectDir.'/.env')) {
|
||||
$dotenv->load($sProjectDir.'/.env');
|
||||
}
|
||||
}
|
||||
|
||||
function getSetting($sConfName, $sDefault = null)
|
||||
|
||||
Reference in New Issue
Block a user