]> git.openstreetmap.org Git - nominatim.git/blob - lib-php/dotenv_loader.php
Merge pull request #3367 from lonvia/address-word-counts
[nominatim.git] / lib-php / dotenv_loader.php
1 <?php
2 /**
3  * SPDX-License-Identifier: GPL-2.0-only
4  *
5  * This file is part of Nominatim. (https://nominatim.org)
6  *
7  * Copyright (C) 2022 by the Nominatim developer community.
8  * For a full list of authors see the git log.
9  */
10
11 require('Symfony/Component/Dotenv/autoload.php');
12
13 function loadDotEnv()
14 {
15     $dotenv = new \Symfony\Component\Dotenv\Dotenv();
16     $dotenv->load(CONST_ConfigDir.'/env.defaults');
17
18     if (file_exists('.env')) {
19         $dotenv->load('.env');
20     }
21 }