JetBrains / idea-php-dotenv-plugin

environment parameters completion, based on .env file keys
MIT License
166 stars 13 forks source link

malfunction of Duplicate key #43

Closed dev-bandai closed 5 years ago

dev-bandai commented 5 years ago

In CakePHP3, reading using josegonzalez / php-dotenv is recommended. https://book.cakephp.org/3.0/en/development/configuration.html#environment-variables

It is possible to set variables from linux env.

export BAR=baz # you can optionally begin with an export statement https://github.com/josegonzalez/php-dotenv#usage

If you write as follows,"inspection info: Duplicate Key" will occur in all "export" locations

#!/usr/bin/env bash
export APP_NAME=${ENV_APP_NAME:-"FooApp"}
export DEBUG=${ENV_DEBUG:-true}
export APP_ENCODING=${ENV_APP_ENCODING:-"UTF-8"}
export APP_DEFAULT_LOCALE=${ENV_APP_DEFAULT_LOCALE:-"ja_JP"}
export APP_DEFAULT_TIMEZONE=${ENV_APP_DEFAULT_TIMEZONE:-"Asia/Tokyo"}

Thank you.

adelf commented 5 years ago

Hi, @dev-bandai

I built the syntax for .env files without this 'export' keyword. But I'll try to fix this in the next version... At least the plugin won't show this warning.

adelf commented 5 years ago

2019.3 version is available.