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: v3.6.2
Choose a base ref
...
head repository: vlucas/phpdotenv
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.6.3
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Apr 11, 2020

  1. Verified

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

Commits on Apr 12, 2020

  1. Verified

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

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1b31030 View commit details
Showing with 57 additions and 49 deletions.
  1. +1 −0 .github/FUNDING.yml
  2. +11 −11 .travis.yml
  3. +45 −38 README.md
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: GrahamCampbell
tidelift: "packagist/vlucas/phpdotenv"
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -5,54 +5,54 @@ matrix:
language: php
php: hhvm-3.18
before_install: travis_retry composer require "phpunit/phpunit:^5.7.27" --dev --no-update -n
install: travis_retry composer install --no-suggest --prefer-dist -n -o
install: travis_retry composer install --prefer-dist -n -o
script: vendor/bin/phpunit
- name: HHVM 3.30
dist: trusty
language: php
php: hhvm-3.30
before_install: travis_retry composer require "phpunit/phpunit:^5.7.27" --dev --no-update -n
install: travis_retry composer install --no-suggest --prefer-dist -n -o
install: travis_retry composer install --prefer-dist -n -o
script: vendor/bin/phpunit
- name: PHP 5.4
dist: trusty
language: php
php: 5.4
install: travis_retry composer install --no-suggest --prefer-dist -n -o
install: travis_retry composer install --prefer-dist -n -o
script: vendor/bin/phpunit
- name: PHP 5.5.9
dist: trusty
language: php
php: 5.5.9
install: travis_retry composer install --no-suggest --prefer-dist -n -o
install: travis_retry composer install --prefer-dist -n -o
script: vendor/bin/phpunit
- name: PHP 5.5
dist: trusty
language: php
php: 5.5
install: travis_retry composer install --no-suggest --prefer-dist -n -o
install: travis_retry composer install --prefer-dist -n -o
script: vendor/bin/phpunit
- name: PHP 5.6
dist: xenial
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:5.6 install --no-suggest --prefer-dist -n -o
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:5.6 install --prefer-dist -n -o
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:5.6
- name: PHP 7.0
dist: xenial
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.0 install --no-suggest --prefer-dist -n -o
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.0 install --prefer-dist -n -o
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:7.0
- name: PHP 7.1
dist: xenial
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.1 install --no-suggest --prefer-dist -n -o
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.1 install --prefer-dist -n -o
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:7.1
- name: PHP 7.2
dist: xenial
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.2 install --no-suggest --prefer-dist -n -o
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.2 install --prefer-dist -n -o
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:7.2
- name: PHP 7.3
dist: xenial
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.3 install --no-suggest --prefer-dist -n -o
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.3 install --prefer-dist -n -o
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:7.3
- name: PHP 7.4
dist: xenial
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.4 install --no-suggest --prefer-dist -n -o
install: travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.4 install --prefer-dist -n -o
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:7.4
83 changes: 45 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
PHP dotenv
==========

Loads environment variables from `.env` to `getenv()`, `$_ENV` and
`$_SERVER` automagically.
Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.

This is a PHP version of the original [Ruby
dotenv](https://github.com/bkeepers/dotenv).

[![Build Status](https://travis-ci.org/vlucas/phpdotenv.svg?branch=master)](https://travis-ci.org/vlucas/phpdotenv)


UPGRADING FROM V2
-----------------

New in Version 3 is first-class support for multiline variables
([#301](https://github.com/vlucas/phpdotenv/pull/301)) and much more
flexibility in terms of which parts of the environment we try to read and
modify ([#300](https://github.com/vlucas/phpdotenv/pull/300)). Consequently,
you will need to replace any occurrences of `new Dotenv(...)` with
`Dotenv::create(...)`, since our new native constructor takes a `Loader`
instance now, so that it can be truly customized if required. Finally, one
should note that the loader will no longer be trimming values
([#302](https://github.com/vlucas/phpdotenv/pull/302)), moreover
`Loader::load()` and its callers now return an associative array of the
variables loaded with their values, rather than an array of raw lines from the
environment file ([#306](https://github.com/vlucas/phpdotenv/pull/306)).
![Banner](https://user-images.githubusercontent.com/2829600/71564012-31105580-2a91-11ea-9ad7-ef1278411b35.png)

For more details, please see the
[release notes](https://github.com/vlucas/phpdotenv/releases/tag/v3.0.0) and
the [upgrading guide](UPGRADING.md).
<p align="center">
<a href="https://travis-ci.org/vlucas/phpdotenv"><img src="https://img.shields.io/travis/vlucas/phpdotenv/master.svg?style=flat-square" alt="Build Status"></img></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-BSD%203--Clause-brightgreen.svg?style=flat-square" alt="Software License"></img></a>
<a href="https://packagist.org/packages/vlucas/phpdotenv"><img src="https://img.shields.io/packagist/dt/vlucas/phpdotenv.svg?style=flat-square" alt="Total Downloads"></img></a>
<a href="https://github.com/vlucas/phpdotenv/releases"><img src="https://img.shields.io/github/release/vlucas/phpdotenv.svg?style=flat-square" alt="Latest Version"></img></a>
</p>


Why .env?
@@ -54,16 +36,46 @@ variables, and you're going to love it!
* EASY portability and sharing of required ENV values
* COMPATIBLE with PHP's built-in web server and CLI runner

PHP dotenv is a PHP version of the original [Ruby
dotenv](https://github.com/bkeepers/dotenv).


Installation with Composer
--------------------------

```shell
composer require vlucas/phpdotenv
Installation is super-easy via [Composer](https://getcomposer.org/):

```bash
$ composer require vlucas/phpdotenv
```

or add it by hand to your `composer.json` file.


UPGRADING FROM V2
-----------------

New in Version 3 is first-class support for multiline variables
([#301](https://github.com/vlucas/phpdotenv/pull/301)) and much more
flexibility in terms of which parts of the environment we try to read and
modify ([#300](https://github.com/vlucas/phpdotenv/pull/300)). Consequently,
you will need to replace any occurrences of `new Dotenv(...)` with
`Dotenv::create(...)`, since our new native constructor takes a `Loader`
instance now, so that it can be truly customized if required. Finally, one
should note that the loader will no longer be trimming values
([#302](https://github.com/vlucas/phpdotenv/pull/302)), moreover
`Loader::load()` and its callers now return an associative array of the
variables loaded with their values, rather than an array of raw lines from the
environment file ([#306](https://github.com/vlucas/phpdotenv/pull/306)).

For more details, please see the
[release notes](https://github.com/vlucas/phpdotenv/releases/tag/v3.0.0) and
the [upgrading guide](UPGRADING.md).


Usage
-----

The `.env` file is generally kept out of version control since it can contain
sensitive API keys and passwords. A separate `.env.example` file is created
with all the required environment variables defined except for the sensitive
@@ -302,14 +314,9 @@ License
PHP dotenv is licensed under [The BSD 3-Clause License](LICENSE).


---
For Enterprise
--------------

Available as part of the Tidelift Subscription

<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/packagist-vlucas-phpdotenv?utm_source=packagist-vlucas-phpdotenv&utm_medium=referral&utm_campaign=readme">Get professional support for PHP dotenv with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
The maintainers of `vlucas/phpdotenv` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-vlucas-phpdotenv?utm_source=packagist-vlucas-phpdotenv&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)