dotenv-org / phpdotenv-vault

Load environment variables from encrypted .env.vault files
https://www.dotenv.org/docs/languages/php
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Fix PHP 7 compatibility & add unit test #8

Closed davidcochrum closed 1 year ago

motdotla commented 1 year ago

Wow @davidcochrum, this is an incredible PR!

I'm hesitant to split the cli into other libraries though (outside the command line cli) because then they could start diverging from each other.

As a php dev what are your thoughts?

Did you know you could also install via homebrew rather than using npx? https://www.dotenv.org/install/

davidcochrum commented 1 year ago

I don't mind maintaining parity between the PHP and Node CLIs ... I don't anticipate them changing all that much anyhow ... I'm working on projects that don't have any other need for Node and my goal was to avoid installing it just for managing envs

davidcochrum commented 1 year ago

I think I just realized that I don't need the CLI in any environment besides dev machines ... is that correct?

motdotla commented 1 year ago

Hi @davidcochrum, sorry to do this to you but I am going to close this.

I made a slew of updates yesterday to fix this library up.

For any changes you would still like to add, could you re-add them under a separate PR. There are too many conflicts here to make it worthwhile. Sorry again for throwing out your hard work like this.

motdotla commented 1 year ago

@davidcochrum I put together a Laravel guide here:

https://www.dotenv.org/docs/frameworks/laravel/heroku

But I also noticed you started building a Laravel package here:

https://gitlab.com/davidcochrum/dotenv-vault-laravel

Would you mind updating that to the latest phpdotenv-vault v0.2.x. Then I'd like to update our Laravel docs to use your plugin.

Also, would you consider hosting that code on GitHub instead of GitLab? We find the community can engage better over GitHub for PRs, comments, etc.

davidcochrum commented 1 year ago

Updated and released v1.1.0 https://gitlab.com/davidcochrum/dotenv-vault-laravel/-/releases/v1.1.0

I have GitLab mirroring to GitHub so any community discussion/contribution will be synced

motdotla commented 1 year ago

I'll work on updating our guides to use your Laravel plugin this evening!

Also could you take a look at this:

https://www.dotenv.org/blog/2023/11/07/phpdotenv-is-inconsistent-across-development-and-production.html

As a more experienced php dev than me, I'd like your take.

davidcochrum commented 1 year ago

There's a whole paragraph in the phpdotenv README about thread safety with getenv() and putenv()

In my experience, most devs don't interact with this library directly, but instead do so indirectly via their framework of choice. Laravel uses the library with safeLoad() and its own configured repositories.

Symfony uses its own library that behaves a bit differently and is completely independent from phpdotenv

motdotla commented 1 year ago

Symfony's implementation looks more sane.