Giter Site home page Giter Site logo

Comments (6)

motin avatar motin commented on May 2, 2024

Aha, I see the discussion and vote-procedure in pr #37 @kelvinj)

from phpdotenv.

kelvinj avatar kelvinj commented on May 2, 2024

@motin are you able to provide a PR? Dotenv v1 should probably now support both variants for BC.

Having 2 ways of doing it is confusing in itself though, and as @vlucas prefers the PHP style I think the upcoming v2 will probably stick with the PHP style.

FWIW v2 also allows multiple loaders, so it will accept a .env.php loader to load variables from a PHP file that returns an array. Therefore, the argument to follow bash-style variable interpolation diminishes somewhat.

from phpdotenv.

vlucas avatar vlucas commented on May 2, 2024

After thinking about it, I think we should stick with bash-style variable interpolation. This is consistent with defining environment variables everywhere else, and still allows the environment variables to work properly when exported or sourced directly in a bash session.

from phpdotenv.

motin avatar motin commented on May 2, 2024

Dotenv v1 should probably now support both variants for BC.

It didn't when I tried. With $FOO set to the string "boo", I ended up with variables like baz_{$FOO}_zoo becoming baz_{boo_zoo.

@motin are you able to provide a PR?

Would it be enough to revert the change in v1.0.8...v1.0.9#diff-9fc34dc20f14743cc88df0c70b48555cL187 or was there other bugs with the previous implementation?

FWIW v2 also allows multiple loaders, so it will accept a .env.php loader to load variables from a PHP file that returns an array. Therefore, the argument to follow bash-style variable interpolation diminishes somewhat.

Sounds good, but I'd suggest that only the php-loader should allow PHP-style variables (and most likely the implementation will not at all be dependent on regex), while remaining bash-style variable interpolation in .env (or .env.sh).

After thinking about it, I think we should stick with bash-style variable interpolation. This is consistent with defining environment variables everywhere else, and still allows the environment variables to work properly when exported or sourced directly in a bash session.

Great to hear! I'll wait with upgrading until 1.2.0 comes out then (please don't add a new breaking change as minor version 1.1.1 :))

from phpdotenv.

kelvinj avatar kelvinj commented on May 2, 2024

It didn't when I tried.

Sorry, I wasn't clear. The bash style was removed and I was saying it should be corrected.

Would it be enough to revert the change in v1.0.8...v1.0.9#diff-9fc34dc20f14743cc88df0c70b48555cL187 …

I think the implementation changed. It should be enough to update the tests & fix the regex.

from phpdotenv.

vlucas avatar vlucas commented on May 2, 2024

In v2.0.0 (tagged just now), it's all bash-style syntax.

from phpdotenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.