From: Sarah Hoffmann Date: Thu, 14 Jan 2021 16:09:22 +0000 (+0100) Subject: move dotenv parsing to installed PHP scripts X-Git-Tag: v3.7.0~57^2~3 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/9348fc5e158454c02f70f9aa2fc149be71d2f6e6 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. --- diff --git a/.github/actions/build-nominatim/action.yml b/.github/actions/build-nominatim/action.yml index e6aec814..3cd826af 100644 --- a/.github/actions/build-nominatim/action.yml +++ b/.github/actions/build-nominatim/action.yml @@ -6,7 +6,7 @@ runs: 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 @@ -16,7 +16,7 @@ runs: - name: Build run: | make -j2 all - ./utils/setup.php --setup-website + ./nominatim refresh --website shell: bash working-directory: build diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index d462a8bb..8dd19aa4 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -47,7 +47,7 @@ jobs: - 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 diff --git a/cmake/script.tmpl b/cmake/script.tmpl index b0e1f535..30b8717b 100755 --- a/cmake/script.tmpl +++ b/cmake/script.tmpl @@ -1,8 +1,12 @@ #!@PHP_BIN@ -Cq load(CONST_DataDir.'/settings/env.defaults'); + + if (file_exists('.env')) { + $dotenv->load('.env'); + } +} diff --git a/lib/lib.php b/lib/lib.php index 5e89916c..7760f695 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -1,7 +1,5 @@ load(CONST_DataDir.'/settings/env.defaults'); - - if (file_exists($sProjectDir.'/.env')) { - $dotenv->load($sProjectDir.'/.env'); - } } function getSetting($sConfName, $sDefault = null)