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.
steps:
- name: Install prerequisits
run: |
steps:
- name: Install prerequisits
run: |
- sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev python3-psycopg2 python3-pyosmium php-symfony-dotenv python3-dotenv
+ sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev python3-psycopg2 python3-pyosmium python3-dotenv
shell: bash
- name: Configure
shell: bash
- name: Configure
- name: Build
run: |
make -j2 all
- name: Build
run: |
make -j2 all
- ./utils/setup.php --setup-website
+ ./nominatim refresh --website
shell: bash
working-directory: build
shell: bash
working-directory: build
- name: Install test prerequsites
run: |
- name: Install test prerequsites
run: |
- sudo apt-get install -y -qq php-codesniffer python3-tidylib
+ sudo apt-get install -y -qq php-codesniffer python3-tidylib php-symfony-dotenv
sudo pip3 install behave
- name: PHP linting
sudo pip3 install behave
- name: PHP linting
+require('@CMAKE_SOURCE_DIR@/lib/dotenv_loader.php');
+
@define('CONST_Default_ModulePath', '@CMAKE_BINARY_DIR@/module');
@define('CONST_Default_Osm2pgsql', '@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql');
@define('CONST_BinDir', '@CMAKE_SOURCE_DIR@/utils');
@define('CONST_DataDir', '@CMAKE_SOURCE_DIR@');
@define('CONST_Default_ModulePath', '@CMAKE_BINARY_DIR@/module');
@define('CONST_Default_Osm2pgsql', '@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql');
@define('CONST_BinDir', '@CMAKE_SOURCE_DIR@/utils');
@define('CONST_DataDir', '@CMAKE_SOURCE_DIR@');
require_once('@CMAKE_SOURCE_DIR@/lib/admin/@script_source@');
require_once('@CMAKE_SOURCE_DIR@/lib/admin/@script_source@');
--- /dev/null
+<?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');
+ }
+}
-require('Symfony/Component/Dotenv/autoload.php');
-
function loadSettings($sProjectDir)
{
@define('CONST_InstallDir', $sProjectDir);
function loadSettings($sProjectDir)
{
@define('CONST_InstallDir', $sProjectDir);
// set of settings.
defined('CONST_DataDir') or define('CONST_DataDir', $_SERVER['NOMINATIM_DATADIR']);
defined('CONST_BinDir') or define('CONST_BinDir', $_SERVER['NOMINATIM_BINDIR']);
// 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)
}
function getSetting($sConfName, $sDefault = null)