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

Overview

PHP dotenv

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

Banner

Software License Total Downloads Latest Version

Why .env?

You should never store sensitive credentials in your code. Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments – such as database credentials or credentials for 3rd party services – should be extracted from the code into environment variables.

Basically, a .env file is an easy way to load custom configuration variables that your application needs without having to modify .htaccess files or Apache/nginx virtual hosts. This means you won't have to edit any files outside the project, and all the environment variables are always set no matter how you run your project - Apache, Nginx, CLI, and even PHP's built-in webserver. It's WAY easier than all the other ways you know of to set environment variables, and you're going to love it!

  • NO editing virtual hosts in Apache or Nginx
  • NO adding php_value flags to .htaccess files
  • 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.

Installation

Installation is super-easy via Composer:

$ composer require vlucas/phpdotenv

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

Upgrading

We follow semantic versioning, which means breaking changes may occur between major releases. We have upgrading guides available for V2 to V3, V3 to V4 and V4 to V5 available here.

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 ones, which are either user-supplied for their own development environments or are communicated elsewhere to project collaborators. The project collaborators then independently copy the .env.example file to a local .env and ensure all the settings are correct for their local environment, filling in the secret keys or providing their own values when necessary. In this usage, the .env file should be added to the project's .gitignore file so that it will never be committed by collaborators. This usage ensures that no sensitive passwords or API keys will ever be in the version control history so there is less risk of a security breach, and production values will never have to be shared with all project collaborators.

Add your application configuration to a .env file in the root of your project. Make sure the .env file is added to your .gitignore so it is not checked-in the code

S3_BUCKET="dotenv"
SECRET_KEY="souper_seekret_key"

Now create a file named .env.example and check this into the project. This should have the ENV variables you need to have set, but the values should either be blank or filled with dummy data. The idea is to let people know what variables are required, but not give them the sensitive production values.

S3_BUCKET="devbucket"
SECRET_KEY="abc123"

You can then load .env in your application with:

$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();

To suppress the exception that is thrown when there is no .env file, you can:

$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->safeLoad();

Optionally you can pass in a filename as the second parameter, if you would like to use something other than .env:

$dotenv = Dotenv\Dotenv::createImmutable(__DIR__, 'myconfig');
$dotenv->load();

All of the defined variables are now available in the $_ENV and $_SERVER super-globals.

$s3_bucket = $_ENV['S3_BUCKET'];
$s3_bucket = $_SERVER['S3_BUCKET'];

Putenv and Getenv

Using getenv() and putenv() is strongly discouraged due to the fact that these functions are not thread safe, however it is still possible to instruct PHP dotenv to use these functions. Instead of calling Dotenv::createImmutable, one can call Dotenv::createUnsafeImmutable, which will add the PutenvAdapter behind the scenes. Your environment variables will now be available using the getenv method, as well as the super-globals:

$s3_bucket = getenv('S3_BUCKET');
$s3_bucket = $_ENV['S3_BUCKET'];
$s3_bucket = $_SERVER['S3_BUCKET'];

Nesting Variables

It's possible to nest an environment variable within another, useful to cut down on repetition.

This is done by wrapping an existing environment variable in ${…} e.g.

BASE_DIR="/var/webroot/project-root"
CACHE_DIR="${BASE_DIR}/cache"
TMP_DIR="${BASE_DIR}/tmp"

Immutability and Repository Customization

Immutability refers to if Dotenv is allowed to overwrite existing environment variables. If you want Dotenv to overwrite existing environment variables, use createMutable instead of createImmutable:

$dotenv = Dotenv\Dotenv::createMutable(__DIR__);
$dotenv->load();

Behind the scenes, this is instructing the "repository" to allow immutability or not. By default, the repository is configured to allow overwriting existing values by default, which is relevant if one is calling the "create" method using the RepositoryBuilder to construct a more custom repository:

$repository = Dotenv\Repository\RepositoryBuilder::createWithNoAdapters()
    ->addAdapter(Dotenv\Repository\Adapter\EnvConstAdapter::class)
    ->addWriter(Dotenv\Repository\Adapter\PutenvAdapter::class)
    ->immutable()
    ->make();

$dotenv = Dotenv\Dotenv::create($repository, __DIR__);
$dotenv->load();

The above example will write loaded values to $_ENV and putenv, but when interpolating environment variables, we'll only read from $_ENV. Moreover, it will never replace any variables already set before loading the file.

By means of another example, one can also specify a set of variables to be allow listed. That is, only the variables in the allow list will be loaded:

$repository = Dotenv\Repository\RepositoryBuilder::createWithDefaultAdapters()
    ->allowList(['FOO', 'BAR'])
    ->make();

$dotenv = Dotenv\Dotenv::create($repository, __DIR__);
$dotenv->load();

Requiring Variables to be Set

PHP dotenv has built in validation functionality, including for enforcing the presence of an environment variable. This is particularly useful to let people know any explicit required variables that your app will not work without.

You can use a single string:

$dotenv->required('DATABASE_DSN');

Or an array of strings:

$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS']);

If any ENV vars are missing, Dotenv will throw a RuntimeException like this:

One or more environment variables failed assertions: DATABASE_DSN is missing

Empty Variables

Beyond simply requiring a variable to be set, you might also need to ensure the variable is not empty:

$dotenv->required('DATABASE_DSN')->notEmpty();

If the environment variable is empty, you'd get an Exception:

One or more environment variables failed assertions: DATABASE_DSN is empty

Integer Variables

You might also need to ensure that the variable is of an integer value. You may do the following:

$dotenv->required('FOO')->isInteger();

If the environment variable is not an integer, you'd get an Exception:

One or more environment variables failed assertions: FOO is not an integer.

One may only want to enforce validation rules when a variable is set. We support this too:

$dotenv->ifPresent('FOO')->isInteger();

Boolean Variables

You may need to ensure a variable is in the form of a boolean, accepting "true", "false", "On", "1", "Yes", "Off", "0" and "No". You may do the following:

$dotenv->required('FOO')->isBoolean();

If the environment variable is not a boolean, you'd get an Exception:

One or more environment variables failed assertions: FOO is not a boolean.

Similarly, one may write:

$dotenv->ifPresent('FOO')->isBoolean();

Allowed Values

It is also possible to define a set of values that your environment variable should be. This is especially useful in situations where only a handful of options or drivers are actually supported by your code:

$dotenv->required('SESSION_STORE')->allowedValues(['Filesystem', 'Memcached']);

If the environment variable wasn't in this list of allowed values, you'd get a similar Exception:

One or more environment variables failed assertions: SESSION_STORE is not an allowed value.

It is also possible to define a regex that your environment variable should be.

$dotenv->required('FOO')->allowedRegexValues('([[:lower:]]{3})');

Comments

You can comment your .env file using the # character. E.g.

# this is a comment
VAR="value" # comment
VAR=value # comment

Parsing Without Loading

Sometimes you just wanna parse the file and resolve the nested environment variables, by giving us a string, and have an array returned back to you. While this is already possible, it is a little fiddly, so we have provided a direct way to do this:

// ['FOO' => 'Bar', 'BAZ' => 'Hello Bar']
Dotenv\Dotenv::parse("FOO=Bar\nBAZ=\"Hello \${FOO}\"");

This is exactly the same as:

Dotenv\Dotenv::createArrayBacked(__DIR__)->load();

only, instead of providing the directory to find the file, you have directly provided the file contents.

Usage Notes

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).

Security

If you discover a security vulnerability within this package, please send an email to Graham Campbell at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

PHP dotenv is licensed under The BSD 3-Clause License.

For Enterprise

Available as part of the Tidelift Subscription

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.

Comments
  • When you have two or more sites on one server, the sites's .env will affect each other

    When you have two or more sites on one server, the sites's .env will affect each other

    php manual: function putenv()

    The environment variable will only exist for the duration of the current request.

        public function setEnvironmentVariable($name, $value = null)
        {
            list($name, $value) = $this->normaliseEnvironmentVariable($name, $value);
    
            // Don't overwrite existing environment variables if we're immutable
            // Ruby's dotenv does this with `ENV[key] ||= value`.
            if ($this->immutable && $this->getEnvironmentVariable($name) !== null) {
                return;
            }
    
            // If PHP is running as an Apache module and an existing
            // Apache environment variable exists, overwrite it
            if (function_exists('apache_getenv') && function_exists('apache_setenv') && apache_getenv($name)) {
                apache_setenv($name, $value);
            }
    
            if (function_exists('putenv')) {
                putenv("$name=$value");
            }
    
            $_ENV[$name] = $value;
            $_SERVER[$name] = $value;
        }
    
        public function getEnvironmentVariable($name)
        {
            switch (true) {
                case array_key_exists($name, $_ENV):
                    return $_ENV[$name];
                case array_key_exists($name, $_SERVER):
                    return $_SERVER[$name];
                default:
                    $value = getenv($name);//****notice line****
                    return $value === false ? null : $value; 
            }
        }
    

    When one request was running, the other request would get this one's env(getenv);

    we can use overload() instead of load() to circumvent this problem;

    This is just a suggestion;

    opened by leesenlen 59
  • Do not throw and exception if .env file is missing

    Do not throw and exception if .env file is missing

    I think it would be a good idea to change the Dotenv::load method so that it wouldn't throw an exception. The motivation for this is that not all environments use a .env file, for example when we deploy to Amazon we configure the environmental variables through OpsWorks. What this means in practice is that I need an additional check in application to see if the file actually exists before calling Dotenv::load. What do you think?

    opened by crisu83 39
  • Detect and convert types

    Detect and convert types

    In my .env file I have values like:

    APP_DEBUG=true
    APP_DEV=false
    

    But the type of these values is always string:

    var_dump(getenv('APP_DEBUG')); // string(4) "true"
    var_dump(getenv('APP_DEV')); // string(5) "false"
    

    I think the values like true, false, null (or even numbers), without quotes, should be converted to the correct type (boolean, integers, etc), because in cases like this, APP_DEV returns "false" so it's evaluated as true:

    if (getenv('APP_DEV')) {
        // do something
    }
    
    opened by oscarotero 35
  • dotenv v2

    dotenv v2

    As mentioned in #43 I've tried a few different things:

    1. PSR-4 and PSR-2
    2. namespaced to Dotenv with main public API in Dotenv\Dotenv
    3. Broken functionality into smaller distinct classes with single responsibility
    4. Changed immutability, making it a little less clunky, so now we have load = immutable and overload = mutable. I know you didn't want to copy the ruby dotenv @vlucas but I felt this was pretty elegant.
    5. Parsing of variables now done with a series of filters. To extend parsing as in #40 the Dotenv\Dotenv class can be extended and a new filter added to the parser. Or indeed a different parser.
    6. I also added a help dotenv() function in order to simplify instantiation, e.g. dotenv()->load(…) as an experiement.
    7. haven't yet implemented a static factory as requested by @bcremer in #43

    Comments please.

    opened by kelvinj 35
  • Multifile merge handling. Dotenv::read method.

    Multifile merge handling. Dotenv::read method.

    Added ability to handle multiple files in the situations where there's need for more than one file to be loaded and variables to be merged / overwritten in the order of the loaded paths.

    Also added Dotenv::read() method, which reads variables without setting them up - useful in the situations where you have to overwrite certain configuration at runtime without changing the environment.

    One use case for these changes is the multi tenancy application where .env files for each tenant are stored in separate directory and only contain variables that should overwrite the ones set up in the main .env file.

    opened by sebastiansulinski 30
  • .env containing duplicates provides confusing outcome

    .env containing duplicates provides confusing outcome

    Hello! Thanks for your library - it's very helpful.

    I recently came across a confusing situation, where I had inadvertently set the same variable twice in a .env file with different values (as part of a Laravel deployment).

    Example:

    APP_DEBUG=false
    ....
    APP_DEBUG=true
    

    Results in APP_DEBUG=false after loading.

    I totally realize that it's my responsibility to ensure that I'm not setting these twice, however I was surprised that there wasn't something that would either warn me about a duplicate, or use the last-set value, since it was set later?

    Is this something that should be handled in the library? I couldn't find an associated test that expresses this concept.

    opened by miketheman 28
  • Variables with \n converted to empty strings (after last updating)

    Variables with \n converted to empty strings (after last updating)

    Hi to all!

    Before the last updating the next variable was working correctly: VARIABLE="Text with\nsome end of lines\n" and in the php when i wrote the next code: echo env('VARIABLE'); returns: Text with\nsome end of lines\n

    After the last update the variable returns: `` <- empty string

    opened by ilnurshax 26
  • add composer/installers to allow the option to customize where the li…

    add composer/installers to allow the option to customize where the li…

    …brary is loaded

    I have a WordPress application where I am going to need to specifically install this library in a separate directory and include it earlier than it would if it were in my default vendor directory. I'm already using the vendor directory in a separate location (mu-plugins with the composer autoloader) which runs much later than I need the dotenv code to run.

    This shouldn't impact anything in your app.

    opened by matgargano 25
  • v2 Release Prep

    v2 Release Prep

    First off -

    Thanks everyone (especially @kelvinj) for all the hard work on v2 so far. I just updated the README file for it, as well as made some naming changes to the assertion methods to make them read better. Check the code and/or the README file to see what I mean.

    My concerns before the release: Now that we have alternate PHP and JSON loaders, I would like to change the variable nesting to match the bash-style syntax instead of the current PHP-style syntax. I would also like to remove support for spaced values that are not quoted.

    The primary motivation for these changes is that I think if you use the bash-style syntax, there shouldn't be any features of phpdotenv that will break bash evaluation of the .env file.

    For instance, pull down the latest v2 branch and run:

    source tests/fixtures/env/nested.env && echo $NVAR4
    

    Then run:

    source tests/fixtures/env/nested.env && echo $NVAR3
    

    And:

    source tests/fixtures/env/commented.env
    

    I also had to switch the example to double quotes instead of single quotes for the bash variable interpolation to work - the same thing that happens in PHP too. Perhaps we should also require double quotes? Is that going too far?

    opened by vlucas 21
  • README needs updating!

    README needs updating!

    I use {"vlucas/phpdotenv": "^4.0.1"}

    Now:

    public static function Dotenv::create(Repository\RepositoryInterface $repository, $paths, $file = null) Dotenv
    

    not compatible with old call:

    Dotenv::create(__DIR__, '_env')
    
    Dotenv::createImmutable( dirname(__DIR__, 1) . '/configs/' ,
            [
                'global', 'credentials', 'options'
            ])->load();
    

    reports:

    Unable to read any of the environment file(s) at [/var/www/project/configs/Array]
    

    I'm forced now to revert depencecy to phpdotenv 3.3 and can't use new functionality.

    Please, don't break compatibility!

    opened by KarelWintersky 19
  • Unable to read any of the environment file(s)

    Unable to read any of the environment file(s)

    Fatal error: Uncaught Dotenv\Exception\InvalidPathException: Unable to read any of the environment file(s) at [C:\xampp\htdocs\homework\public.env]. in C:\xampp\htdocs\homework\vendor\vlucas\phpdotenv\src\Loader.php:133 Stack trace: #0 C:\xampp\htdocs\homework\vendor\vlucas\phpdotenv\src\Loader.php(91): Dotenv\Loader::findAndRead(Array) #1 C:\xampp\htdocs\homework\vendor\vlucas\phpdotenv\src\Dotenv.php(123): Dotenv\Loader->load() #2 C:\xampp\htdocs\homework\vendor\vlucas\phpdotenv\src\Dotenv.php(80): Dotenv\Dotenv->loadData() #3 C:\xampp\htdocs\homework\public\index.php(8): Dotenv\Dotenv->load() #4 {main} thrown in C:\xampp\htdocs\homework\vendor\vlucas\phpdotenv\src\Loader.php on line 133

    opened by deniskulygin 19
  • References to variables which are not set are left expanded

    References to variables which are not set are left expanded

    Summary

    If .env references a variable (e.g. ${FOO}) which is not already set (either via the external environment, or in the .env file, it is left unexpanded.

    This is in contrast to the following other languages / implementations which will expand the variable to an empty string:

    Demo

    Consider this .env file:

    # A simple, constant env var
    CONST='A constant env var'
    
    # Derived from another variable
    DERIV="I came from ${CONST} with some more"
    
    # An environment variable we expect to be set on the outside
    EXT_SET=${ENV_EXT_SET}
    
    # An environment variable we expect *not* to be set on the outside
    EXT_UNSET=${ENV_EXT_UNSET}
    

    When loaded by bash, EXT_UNSET will get the value "" (that is, the empty string).

    When loaded by phpdotenv v5.2.0, EXT_UNSET will get the value "${ENV_EXT_UNSET}" (literally).

    See this gist for a full reproducible example:

    $ pip3 install scuba
    $ ./prepare.sh
    $ ./run_test.sh
    ------------------------------------------------------
    Bash:
    CONST=A constant env var
    DERIV=I came from A constant env var with some more
    EXT_SET=set externally
    EXT_UNSET=
    
    ------------------------------------------------------
    phpdotenv:
    $_ENV = Array
    (
        [CONST] => A constant env var
        [DERIV] => I came from A constant env var with some more
        [EXT_SET] => set externally
        [EXT_UNSET] => ${ENV_EXT_UNSET}
    )
    
    ------------------------------------------------------
    python-dotenv:
    CONST=A constant env var
    DERIV=I came from A constant env var with some more
    EXT_SET=set externally
    EXT_UNSET=
    

    References

    • Upstream issue: https://github.com/snipe/snipe-it/issues/6578
    opened by JonathonReinhart 6
Releases(v5.5.0)
  • v5.5.0(Oct 16, 2022)

    We announce the immediate availability V5.5.0.

    New Features

    • Add support for unicode variable names (1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7)

    Changes

    • Add official support for PHP 8.2 (b674e23043fb054147eea190465467a71dd2ed85)
    • Made repository checks a little stricter (4c165455a670005a05edbdf97a5590aa3e4936ec)

    Bug Fixes

    • Fix issue where line ending in =" is incorrectly marked as a multi-line start (f9266951999a6a4059a6edea926a1d19f40cfc3b)
    Source code(tar.gz)
    Source code(zip)
  • v4.3.0(Oct 16, 2022)

    We announce the immediate availability V4.3.0.

    Changes

    • Add official support for PHP 8.2 (c349cad3c63eae4343ceaa0d404db173fc9867d1)
    • Made repository checks a little stricter (3b56df14b76e8f3dcec6376e5e4ac5cb0386b2c6)

    Bug Fixes

    • Fix issue where line ending in =" is incorrectly marked as a multi-line start (67a491df68208bef8c37092db11fa3885008efcf)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.1(Dec 12, 2021)

    We announce the immediate availability V5.4.1.

    Bug Fixes

    • Updated author homepages (2e93cc98e2e8e869f8d9cfa61bb3a99ba4fc4141)
    • Cleaned up phpdoc types (264dce589e7ce37a7ba99cb901eed8249fbec92f)
    Source code(tar.gz)
    Source code(zip)
  • v4.2.2(Dec 12, 2021)

    We announce the immediate availability V4.2.2.

    Bug Fixes

    • Updated author homepages (2e93cc98e2e8e869f8d9cfa61bb3a99ba4fc4141)
    • PHP 8.1 compatibility fixes (5b547cdb25825f10251370f57ba5d9d924e6f68e)
    Source code(tar.gz)
    Source code(zip)
  • v3.6.10(Dec 12, 2021)

    We announce the immediate availability V3.6.10.

    Bug Fixes

    • Updated author homepages (2e93cc98e2e8e869f8d9cfa61bb3a99ba4fc4141)
    • PHP 8.1 compatibility fixes (5b547cdb25825f10251370f57ba5d9d924e6f68e)
    Source code(tar.gz)
    Source code(zip)
  • v2.6.9(Dec 12, 2021)

  • v5.4.0(Nov 10, 2021)

  • v5.3.1(Oct 2, 2021)

    We announce the immediate availability V5.3.1.

    Bug Fixes

    • Fixed edge case issues on PHP 8.1 (622df6a3c8113b9ee92f9e0a8add275b7d6aa1a1, 4a4a82c234ae2cfd28200eb865b37dd3ff29e673, accaddf133651d4b5cf81a119f25296736ffc850)
    Source code(tar.gz)
    Source code(zip)
  • v4.2.1(Oct 2, 2021)

    We announce the immediate availability V4.2.1.

    Bug Fixes

    • Fixed edge case issues on PHP 8.1 (6854d24330acf6b667299a490d1475b16d1c4749, d38f4d1edcbe32515a0ad593cbd4c858e337263c)
    Source code(tar.gz)
    Source code(zip)
  • v3.6.9(Oct 2, 2021)

    We announce the immediate availability V3.6.9.

    Bug Fixes

    • Fixed edge case issues on PHP 8.1 (51a8a7b2abfe1d628252cf6cfccd6b8ecbddbfb2, a1bf4c9853d90ade427b4efe35355fc41b3d6988)
    Source code(tar.gz)
    Source code(zip)
  • v2.6.8(Oct 2, 2021)

  • v5.3.0(Jan 20, 2021)

    We announce the immediate availability V5.3.0.

    New Features

    • Made Validator::assert and Validator::assertNullable public (b3eac5c7ac896e52deab4a99068e3f4ab12d9e56)

    Bug Fixes

    • Reject env files with missmatched quotes (ef736adce235936a030be921e8c25b12a8ee2eb6)
    Source code(tar.gz)
    Source code(zip)
  • v4.2.0(Jan 20, 2021)

    We announce the immediate availability V4.2.0.

    New Features

    • Backported Dotenv::createArrayBacked() and Dotenv::parse() (b56a06737822956e1d408304315946f50fa39bc5)

    Bug Fixes

    • Reject env files with missmatched quotes (e9a36be8898e927403d42409e1401020fab0e6a2)
    Source code(tar.gz)
    Source code(zip)
  • v3.6.8(Jan 20, 2021)

    We announce the immediate availability V3.6.8.

    Bug Fixes

    • Reject env files with missmatched quotes (04e416a863cb1b43caf489adb01a6591d4b11a18)
    Source code(tar.gz)
    Source code(zip)
  • v2.6.7(Jan 20, 2021)

    We announce the immediate availability V2.6.7.

    Bug Fixes

    • Reject env files with missmatched quotes (7417448b378af024801ea96027e805b1db12401d)
    Source code(tar.gz)
    Source code(zip)
  • v5.2.0(Sep 14, 2020)

  • v5.1.0(Jul 14, 2020)

    We announce the immediate availability V5.1.0.

    New Features

    • Added Dotenv::createArrayBacked() and Dotenv::parse() (ad9eb3f8a08906ce477d8ec4638915c98e562044)
    Source code(tar.gz)
    Source code(zip)
  • v5.0.1(Jul 14, 2020)

  • v4.1.8(Jul 14, 2020)

    We announce the immediate availability V4.1.8.

    Bug Fixes

    • Bumped minimum ctype polyfill (e1d57f62db3db00d9139078cbedf262280701479)
    • Fixed preg error lookup for all PHP versions (d4c24c31b5a5a83b77515b499a04f5c1a72a8791)
    • Added additional type information and fixed edge cases
    Source code(tar.gz)
    Source code(zip)
  • v3.6.7(Jul 14, 2020)

    We announce the immediate availability V3.6.7.

    Bug Fixes

    • Bumped minimum ctype polyfill (e1d57f62db3db00d9139078cbedf262280701479)
    • Fixed preg error lookup for all PHP versions (d4c24c31b5a5a83b77515b499a04f5c1a72a8791)
    Source code(tar.gz)
    Source code(zip)
  • v2.6.6(Jul 14, 2020)

  • v5.0.0(Jun 7, 2020)

    We announce the immediate availability V5.0.0.

    We've made some further improvements to this library, since v4, maintaining the same API where possible.

    New Features

    • Support for multibyte values
    • More flexible repositories
    • Disable get/putenv by default
    • Replaced whitelists by allow lists
    • Strict parameter typing

    Upgrading Notes

    Please see the upgrading guide.

    Source code(tar.gz)
    Source code(zip)
  • v4.1.7(Jun 7, 2020)

  • v3.6.6(Jun 7, 2020)

  • v2.6.5(Jun 7, 2020)

  • v4.1.6(May 23, 2020)

    We announce the immediate availability V4.1.6.

    Bug Fixes

    • Graceful preg error handling when parsing names (8f71e9a538bddac9e9646dcabb4a8076d53b9e09)
    Source code(tar.gz)
    Source code(zip)
  • v3.6.5(May 23, 2020)

    We announce the immediate availability V3.6.5.

    Bug Fixes

    • Graceful preg error handling when parsing names (5c8934c0f2f3be08784e5e393df3821dd169aa0c)
    Source code(tar.gz)
    Source code(zip)
  • v4.1.5(May 2, 2020)

  • v3.6.4(May 2, 2020)

  • v2.6.4(May 2, 2020)

Owner
Vance Lucas
Co-founder of @techlahoma. Creator of BudgetSheet, Frisby.js, phpdotenv, valitron, and other open-source projects. Engineering Lead/Manager. FT Remote from OKC
Vance Lucas
Config is a file configuration loader that supports PHP, INI, XML, JSON, YML, Properties and serialized files and string

Config Config is a file configuration loader that supports PHP, INI, XML, JSON, YML, Properties and serialized files and strings. Requirements Config

Hassan Khan 946 Jan 1, 2023
AWS SDK with readable code and async responses

AsyncAws client If you are one of those people that like the Amazon PHP SDK but hate the fact that you need to download Guzzle, PSR-7 and every AWS AP

Async AWS 375 Dec 24, 2022
This library can parse a TypeSchema specification either from a JSON file, or from PHP classes using reflection and annotations.

This library can parse a TypeSchema specification either from a JSON file, or from PHP classes using reflection and annotations. Based on this schema it can generate source code and transform raw JSON data into DTO objects. Through this you can work with fully typed objects in your API for incoming and outgoing data.

Apioo 54 Jul 14, 2022
Symfony Dotenv parses .env files to make environment variables stored in them accessible via getenv(), $_ENV, or $_SERVER.

Dotenv Component Symfony Dotenv parses .env files to make environment variables stored in them accessible via $_SERVER or $_ENV. Getting Started $ com

Symfony 3.5k Jan 5, 2023
Preferences are configuration variables that are user-managed for which we cannot rely upon container parameters or environment variables.

Preferences Preferences are configuration variables that are meant to be user managed for which we cannot rely upon container parameters or environmen

Makina Corpus 1 Feb 7, 2022
A Laravel package that allows you to use multiple ".env" files in a precedent manner. Use ".env" files per domain (multi-tentant)!

Laravel Multi ENVs Use multiple .envs files and have a chain of precedence for the environment variables in these different .envs files. Use the .env

Allyson Silva 48 Dec 29, 2022
A simple shell script which loads a magento environment

A simple shell script to load up a Magento environment and execute PHP code Very experimental and should only be ran on dev servers REQUIRES php pcntl

beeplogic 28 Feb 4, 2022
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. ?? Demo (coming so

Waren Gonzaga 3 Nov 15, 2021
A simple platform information plugin for WordPress. Shows you environment variables, PHP settings and more.

A simple platform information plugin for WordPress. Shows you environment variables, PHP settings and more.

New To Vaux 2 Sep 7, 2022
Automagically generate UML diagrams of your Laravel code.

Laravel UML Diagram Generator Automagically generate UML diagrams of your Laravel code. Installation To install LTU via composer, run the command: com

Andy Abi Haidar 93 Jan 1, 2023
A simple library to increase the power of your environment variables.

Environment A simple library (with all methods covered by php unit tests) to increase the power of your environment variables, contribute with this pr

João Paulo Cercal 56 Feb 8, 2022
Composer install helper outsourcing sensitive keys from the package URL into environment variables

private-composer-installer This is a Composer plugin offering a way to reference private package URLs within composer.json and composer.lock. It outso

Fränz Friederes 213 Dec 12, 2022
The Yaml component loads and dumps YAML files.

Yaml Component The Yaml component loads and dumps YAML files. Resources Documentation Contributing Report issues and send Pull Requests in the main Sy

Symfony 3.5k Dec 30, 2022
Caches responses as static files on disk for lightning fast page loads.

Laravel Page Cache This package allows you to easily cache responses as static files on disk for lightning fast page loads. Introduction Installation

Joseph Silber 1k Dec 16, 2022
This Laravel Nova settings tool based on env, using nativ nova fields and resources

Nova Settings Description This Laravel Nova settings tool based on env, using nativ nova fields and resources Features Using native Nova resources Ful

Artem Stepanenko 21 Dec 28, 2022
⚡️Lightning-fast linter for .env files. Written in Rust 🦀

⚡️ Lightning-fast linter for .env files. Written in Rust ?? Dotenv-linter can check / fix / compare .env files for problems that may cause the applica

null 1.5k Dec 31, 2022
A tool to profile mysql queries in php env.

MysqlQueryProfiler This tool helps you to quickly profile a mysql query in a PHP 7.4+ environnement. You can also compare 2 queries. This image shows

null 8 Jul 30, 2021
⚙️ A WordPress plugin to set WordPress options from a .env file.

dotenv A WordPress plugin to set WordPress options from a .env file. Any WPENV_ prefixed variables in the .env will be used to override the WordPress

Brad Parbs 13 Oct 6, 2022
A PHP library to write values to .env (DotEnv) files

DotEnvWriter A PHP library to write values to .env (DotEnv) files Installation DotEnvWriter can be installed with Composer. composer require mirazmac/

Miraz Mac 9 May 24, 2022
Load .env files for PHP.

PHP DotEnv Loader Simple library to load and get values from .env file(s). Install composer require murilo-perosa/dot-env How to Use Namespace use Mur

Murilo Perosa 1 Jan 15, 2022