1 | <?php |
||
2 | |||
3 | use Symfony\Component\Dotenv\Dotenv; |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | // The check is to ensure we don't use .env in production |
||
6 | if (!isset($_SERVER['APP_ENV'])) { |
||
7 | if (!class_exists(Dotenv::class)) { |
||
8 | throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); |
||
9 | } |
||
10 | (new Dotenv())->load(__DIR__.'/../../.env'); |
||
11 | } |
||
12 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths