Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #33: Add vlucas/phpdotenv for LAMP stack users. #1

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/digit-drupal-site-test-reference/

# Ignore local configuration files.
/.env
/behat.yml
/grumphp.yml
/runner.yml
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ takes several minutes. At the end you will be asked whether to remove the
existing version history. It is recommended to confirm this question so that you
can start your project with a clean slate.

After installing the dependencies, install a clean installation of your site, using the following command:
After installing the dependencies, create a .env file based on .env.example and configure the variables to match your setup:

```bash
cp .env.example .env
```

Next, perform a clean installation of your site by usin the following command:

```bash
./vendor/bin/run toolkit:install-clean
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"drupal/console": "~1.6",
"drupal/drupal-extension": "~4.0",
"ec-europa/toolkit": "~4.0.0-beta2",
"vlucas/phpdotenv": "^3.3",
"webflo/drupal-core-require-dev": "~8.7"
},
"scripts": {
Expand Down Expand Up @@ -68,6 +69,7 @@
]
},
"autoload-dev": {
"files": ["load.environment.php"],
"psr-4": {
"OpenEuropa\\Site\\Tests\\": "./tests/"
}
Expand Down
23 changes: 23 additions & 0 deletions load.environment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* @file
* Loads the .env file.
*
* This file is included very early. See autoload.files in composer.json.
*/

use Dotenv\Dotenv;
use Dotenv\Exception\InvalidPathException;

/**
* Load any .env file. See /.env.example.
*/
$dotenv = Dotenv::create(__DIR__);

try {
$dotenv->load();
}
catch (InvalidPathException $e) {
// Do nothing. Production environments rarely use .env files.
}