From 10343cbc88141d1941e6c7ed5c5d2cb91a64731e Mon Sep 17 00:00:00 2001 From: Aldarien Date: Wed, 29 Apr 2020 23:47:01 -0400 Subject: [PATCH] Dot ENV --- bootstrap/app.php | 1 + bootstrap/common/config.php | 2 +- bootstrap/dotenv.php | 3 +++ composer.json | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 bootstrap/dotenv.php diff --git a/bootstrap/app.php b/bootstrap/app.php index 22a533d..f2b14b7 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,6 +3,7 @@ use DI\ContainerBuilder as Builder; use DI\Bridge\Slim\Bridge; include_once 'composer.php'; +include_once 'dotenv.php'; $builder = new Builder(); $folders = ['common']; diff --git a/bootstrap/common/config.php b/bootstrap/common/config.php index 93cce41..0a84a2c 100644 --- a/bootstrap/common/config.php +++ b/bootstrap/common/config.php @@ -1,6 +1,6 @@ '/provm/totalsport', + 'urls.base' => getenv('BASE_URL'), 'folders.base' => dirname(__DIR__, 2), 'folders.resources' => DI\string(implode(DIRECTORY_SEPARATOR, [ '{folders.base}', diff --git a/bootstrap/dotenv.php b/bootstrap/dotenv.php new file mode 100644 index 0000000..6d0ae53 --- /dev/null +++ b/bootstrap/dotenv.php @@ -0,0 +1,3 @@ +load(); diff --git a/composer.json b/composer.json index b66ed82..35a350e 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ "nyholm/psr7-server": "^0.4.1", "rubellum/slim-blade-view": "^0.1.1", "mustangostang/spyc": "^0.6.3", - "voku/stringy": "^6.2" + "voku/stringy": "^6.2", + "vlucas/phpdotenv": "^4.1" }, "require-dev": { "phpunit/phpunit": "^8.5",