Cube-Solutions / composer-dist-installer

Install template files (.dist) automatically on project setup with Composer. Framework-agnostic.
MIT License
2 stars 3 forks source link

Add the capacity to recurse among default values #1

Closed vincentlepot closed 9 years ago

vincentlepot commented 9 years ago

Instead of having only one default value possible in the template (eg {{Question|default}}), this PR add the ability to chain multiple default values.

This can be useful to use env variables as a first default if available and, if not, fall back to a string. eg:

{{My param []?|=ENV[MY_PARAM_ENV]|default}}

If MY_PARAM_ENV variable is set, use it as default, else use "default" hardcoded string.

In a deployment process, as a non-interactive execution, you can have you secrets set as env variables (and fall back to default values if not set).

mikeSimonson commented 9 years ago

@gabrielsomoza scrutinizer failed because of the travis config look at the configuration of doctrine/migrations to avoid sending empty clover report.

gsomoza commented 9 years ago

Thanks for your contribution @vincentlepot, its a great idea. Any chance you could also update the README.md file to document these changes?

@mikeSimonson the Scrutinizer issue should be fixed now in master, thanks for the info.

vincentlepot commented 9 years ago

@gabrielsomoza You're right, I'll take care of the README.md :)

vincentlepot commented 9 years ago

README updated ;)

gsomoza commented 9 years ago

Awesome, thanks so much for your contribution! Merging now.

vincentlepot commented 9 years ago

You're welcome. Can you ping me when you tag the release?

gsomoza commented 9 years ago

Done :+1:

vincentlepot commented 9 years ago

Thanks a lot (just one thing: you missed the 'v' at the beginning if you want to keep consistent, but it works ;))

gsomoza commented 9 years ago

That was actually on purpose: starting with that release I'm going to start tagging them without the 'v'. Just because it makes tags easier to read I think (the v is not needed). I'll keep it release titles though. Reason: it seems to be the way other big libraries do it :)

You have a great eye for detail btw, love it.