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
dotenv v2 #44
dotenv v2 #44
Conversation
Oh, and I haven't updated the readme at all. |
Man, solid start. Huge kudos. I am wrapping up some work right now, and won't be able to thoroughly look this over until the first week of November (a few days). I'll be able to give you some more in-depth feedback then. The one thing I planned on doing in v2 that I don't see here is that I was strongly considering adding different parser types, so that Dotenv could also support a simpler |
@vlucas yep, good idea. ok. In a way, that's not really a parser… so maybe I'm missing a concept. I'll have a think. |
Also, big update here: https://github.com/brightmachine/phpdotenv/pull/3. |
@GrahamCampbell sorry, just did a large refactor before seeing your PRs. 😞 |
I'll rebase the first 2 right now... |
A few more updates:
One change I think I'll make is to be smarter about what happens when you call |
@GrahamCampbell cheers. |
Rebased. |
Added a blank line after opening php
Matched file names with class names in the tests
Didn't clarify that now Question for @vlucas re: the
|
I would say do (1) because that's now they are going to be when retrieved back with |
Any news on this guys? |
- boolean values `true && false` handled as strings `'true' && 'false'` - other scalars cast to strings - other complex types return empty string
Just pushed up last change around casting After this, just need some more feedback from @vlucas If he's happy with this, then it's a matter of updating the docs and getting |
It also would be cool to have a final |
I am doing a complete review of all this code now. |
Great. :) |
Okay - I have reviewed it all, and only had a few minor changes. Next, I am going to use it in some projects of mine and see how that goes before releasing. Thanks for all your hard work, @kelvinj! |
👍 |
Cool. Any chance of merging this to a v2 branch? |
It is currently in https://github.com/vlucas/phpdotenv/tree/brightmachine-v2 |
@vlucas thanks. |
This can be closed then? |
I do want to talk for a minute about the |
I do find the current What about introducing another concept, variable assertion? <?php
$dotenv->assert('VAR')->exists();
$dotenv->assert('VAR')->notEmpty();
$dotenv->assert('VAR')->contains(array('option1', 'option2')); |
Hmmm... I kind of like that. It would have to also support multiple variables though, so it would not be overly verbose. I would also like to allow chaining, like so: $dotenv->assert(['FOO', 'BAR', 'BAZ'])->exists()->notEmpty(); |
Surely there should be another pull request created to merge the v2 from this repo to the master of this repo? |
Branch proposal: Create a |
I just merged @kelvinj's code and pushed a v2 branch. I am in the process of testing it now and will publish it as v2 shortly. |
Feel free to test out the new version by using version |
Closing this PR as I have merged the code manually into branch |
@vlucas let me know what you need to get v2 out the door. Readme? Changelog? |
I do need a README update, but I plan on doing that in a few hours. I couldn't possibly ask you to do any more for v2! :) |
Probably a good thing too from your perspective… when it comes to explaining things in plain English, well, let's say it's something I'm continually trying to improve upon. |
As mentioned in #43 I've tried a few different things:
Dotenv
with main public API inDotenv\Dotenv
load
= immutable andoverload
= mutable. I know you didn't want to copy the ruby dotenv @vlucas but I felt this was pretty elegant.Dotenv\Dotenv
class can be extended and a new filter added to the parser. Or indeed a different parser.dotenv()
function in order to simplify instantiation, e.g.dotenv()->load(…)
as an experiement.Comments please.