|
13 | 13 |
|
14 | 14 | Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP. |
15 | 15 |
|
| 16 | +* [Why?](#why) |
| 17 | +* [Requirements](#requirements) |
| 18 | +* [Install](#install) |
| 19 | +* [Usage](#usage) |
| 20 | + * [Basic](#basic) |
| 21 | + * [Syntax](#syntax) |
| 22 | + * [Assignment](#assignment) |
| 23 | + * [Strings](#strings) |
| 24 | + * [Numbers](#numbers) |
| 25 | + * [Booleans](#booleans) |
| 26 | + * [Null](#null) |
| 27 | + * [Variables](#variables) |
| 28 | + * [Default Value/Assignment](#parameter-expansion) |
| 29 | + * [Comments](#comments) |
| 30 | + * [.env example)(#env-example) |
| 31 | +* [Other library comparisons](#other-library-comparisons) |
| 32 | +* [Todo](#todo) |
| 33 | +* [Change log](#change-log) |
| 34 | +* [Testing](#testing) |
| 35 | +* [Contributing](#Contributing) |
| 36 | +* [Security](#security) |
| 37 | +* [Credits](#credits) |
| 38 | +* [License](#license) |
| 39 | + |
| 40 | + |
16 | 41 | ## Why? |
17 | 42 | Env aims to bring a unified parser for env together for PHP rather than having a few incomplete or buggy parsers written |
18 | 43 | into other libraries. This library is not meant as a complete package for config loading like other libraries as this |
@@ -203,6 +228,8 @@ TEST2 = ${TEST1} # `null` type |
203 | 228 | TEST3 = "${TEST1}" # `string` type |
204 | 229 | ``` |
205 | 230 |
|
| 231 | +##### Parameter Expansion |
| 232 | + |
206 | 233 | You can do parameter expansion, so far you can only do [default values](http://wiki.bash-hackers.org/syntax/pe#use_a_default_value) |
207 | 234 | and [assign default values](http://wiki.bash-hackers.org/syntax/pe#assign_a_default_value) like in the bash syntax: |
208 | 235 |
|
@@ -268,7 +295,7 @@ To comment, just use the `#` syntax, you can also comment inline like so: |
268 | 295 | TEST1 = bar # and so is this |
269 | 296 | ``` |
270 | 297 |
|
271 | | -### full .env example |
| 298 | +### .env example |
272 | 299 |
|
273 | 300 | ```bash |
274 | 301 | # Comments are done like this |
@@ -360,9 +387,9 @@ TEST59=${TEST60:=null} # TEST59 = null TEST60 = null -- both `null` types |
360 | 387 | TEST61=${TEST62:=true} # TEST61 = true TEST62 = true -- both `bool` types |
361 | 388 |
|
362 | 389 | # Comments |
363 | | -TEST62 = hello # comment |
364 | | -TEST63 = "hello # comment" |
365 | | -TEST64 = "hello" #comment |
| 390 | +TEST63 = hello # comment |
| 391 | +TEST64 = "hello # comment" |
| 392 | +TEST65 = "hello" #comment |
366 | 393 | TEST66 = #comment |
367 | 394 | TEST67 = "#comment" |
368 | 395 | ``` |
@@ -441,6 +468,9 @@ array( |
441 | 468 | ## Other library comparisons |
442 | 469 | todo |
443 | 470 |
|
| 471 | +## Todo |
| 472 | +- Other library comparisons |
| 473 | +- [Other bash parameter expansions](http://wiki.bash-hackers.org/syntax/pe#display_error_if_null_or_unset) |
444 | 474 | ## Change log |
445 | 475 |
|
446 | 476 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. |
|
0 commit comments