Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vlucas/phpdotenv
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.0
Choose a base ref
...
head repository: vlucas/phpdotenv
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.0.1
Choose a head ref
  • 5 commits
  • 4 files changed
  • 5 contributors

Commits on Nov 30, 2019

  1. Fixed typos in docs

    GrahamCampbell committed Nov 30, 2019

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8d033db View commit details

Commits on Dec 2, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    6c4f31a View commit details

Commits on Dec 3, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    6ca3a1d View commit details

Commits on Dec 6, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a2ce48f View commit details

Commits on Dec 8, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    55dc901 View commit details
Showing with 6 additions and 16 deletions.
  1. +1 −11 README.md
  2. +3 −3 UPGRADING.md
  3. +1 −1 src/Dotenv.php
  4. +1 −1 src/Repository/RepositoryBuilder.php
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -184,7 +184,7 @@ $repository = Dotenv\Repository\RepositoryBuilder::create()
new Dotenv\Repository\Adapter\PutenvAdapter(),
])
->immutable()
->get();
->make();

$dotenv = Dotenv\Dotenv::create($repository, __DIR__);
$dotenv->load();
@@ -302,16 +302,6 @@ When a new developer clones your codebase, they will have an additional
**one-time step** to manually copy the `.env.example` file to `.env` and fill-in
their own values (or get any sensitive values from a project co-worker).

### Command Line Scripts

If you need to use environment variables that you have set in your `.env` file
in a command line script that doesn't use the Dotenv library, you can `source`
it into your local shell session:

```
source .env
```


Security
--------
6 changes: 3 additions & 3 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## V3 to V4

V4 has again changed the way you initialize the `Dotenv` class. If you want immutable loading of environment variables, then replace `Dotenv::create` with `Dotenv::createImmutable`, and if you want mutable loading, replace `Dotenv::create` with `Dotenv::createMmutable` and `->overload()` with `->load()`. The `overload` method has been removed in faviour of specifying mutability at object construction.
V4 has again changed the way you initialize the `Dotenv` class. If you want immutable loading of environment variables, then replace `Dotenv::create` with `Dotenv::createImmutable`, and if you want mutable loading, replace `Dotenv::create` with `Dotenv::createMutable` and `->overload()` with `->load()`. The `overload` method has been removed in faviour of specifying mutability at object construction.

The behaviour when parsing single quoted strings has now changed, to mimic the behaviour of bash. It is no longer possible to escape characters in single quoted strings, and everything is treated literally. As soon as the first single quote character is read, after the initial one, then the variable is treated as ending immediately at that point. When parsing unquoted or double quoted strings, it is now possible to escape dollar signs, to forcefully avoid variable interpolation. Escaping dollars is not mandated, in the sense that if a dollar is present, and not following by variable interpolation sytnax, this is allowed, and the dollar will be treated as a literal dollar. Finally, interpolation of variables is now performed right to left, instead of left to right, so it is possible to nest interpolations to allow using the value of a variable as the name of another for further interpolation.

@@ -36,7 +36,7 @@ $repository = RepositoryBuilder::create()
->withReaders($adapters)
->withWriters($adapters)
->immutable()
->get();
->make();

Dotenv::create($repository, $path, null)->load();
```
@@ -55,7 +55,7 @@ $adapters = [new ArrayAdapter()];
$repository = RepositoryBuilder::create()
->withReaders($adapters)
->withWriters($adapters)
->get();
->make();

$variables = (new Loader())->load($repository, $content);
```
2 changes: 1 addition & 1 deletion src/Dotenv.php
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ public static function createMutable($paths, $file = null)
}

/**
* Create a new mutable dotenv instance with default repository.
* Create a new immutable dotenv instance with default repository.
*
* @param string|string[] $paths
* @param string|null $file
2 changes: 1 addition & 1 deletion src/Repository/RepositoryBuilder.php
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ private function __construct(array $readers = null, array $writers = null, $immu
/**
* Create a new repository builder instance.
*
* @return void
* @return \Dotenv\Repository\RepositoryBuilder
*/
public static function create()
{