{"id":40028197,"url":"https://github.com/rayanlevert/dotenv","last_synced_at":"2026-01-19T04:04:20.772Z","repository":{"id":210189487,"uuid":"725944938","full_name":"rayanlevert/dotenv","owner":"rayanlevert","description":"Dependency-free environment file handler (.env) loading variables and its values in $_ENV, $_SERVER and getenv() in the PHP userland","archived":false,"fork":false,"pushed_at":"2025-08-16T04:53:06.000Z","size":73,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T04:12:44.830Z","etag":null,"topics":["dependency-free","dotenv","dotenv-loader","dotenv-parser","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rayanlevert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-01T07:45:20.000Z","updated_at":"2025-08-16T04:53:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"87463423-1610-4626-b703-d6b740302501","html_url":"https://github.com/rayanlevert/dotenv","commit_stats":null,"previous_names":["rayanlevert/dotenv"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/rayanlevert/dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayanlevert%2Fdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayanlevert%2Fdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayanlevert%2Fdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayanlevert%2Fdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayanlevert","download_url":"https://codeload.github.com/rayanlevert/dotenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayanlevert%2Fdotenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28561750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-free","dotenv","dotenv-loader","dotenv-parser","php"],"created_at":"2026-01-19T04:04:20.161Z","updated_at":"2026-01-19T04:04:20.768Z","avatar_url":"https://github.com/rayanlevert.png","language":"PHP","readme":"## Simple, dependency-free and fast class handling an environment file to `$_ENV`, `$_SERVER` and `getenv()`\n\n[![Packagist Version](https://img.shields.io/packagist/v/rayanlevert/dotenv)](https://packagist.org/packages/rayanlevert/dotenv)\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/rayanlevert/dotenv)](https://packagist.org/packages/rayanlevert/dotenv)\n[![codecov](https://codecov.io/gh/rayanlevert/dotenv/branch/main/graph/badge.svg)](https://codecov.io/gh/rayanlevert/dotenv)\n\n\u003e Version \u003e= 3.0 supports only php8.4 with all brand new features, for \u003e= php8.1, version 2.0 is still supported.\n\n### Initializes the instance setting the file path\n\n```php\n$oDotenv = new \\RayanLevert\\Dotenv\\Dotenv('/file/to/.dotenv');\n```\nAn exception `RayanLevert\\Dotenv\\Exception` will be thrown if the file is not readable\n\n### Reads the file content and loads in `$_ENV`, `$_SERVER` et `getenv()`, values of each variable\n\n```php\n$oDotenv-\u003eload();\n```\n\n#### For each new line found, tries to set to the name of the variable its value after the `=` sign\n\n```\nTEST_VALUE1=value1 =\u003e $_ENV['TEST_VALUE1'] = value1\n```\n\n## If the value is a primitive value, the value will be casted to the `PHP` userland\n\n```php\nNAME=1 =\u003e $_ENV['NAME'] = 1\nNAME=23.34 =\u003e $_ENV['NAME'] = 23.34 (float values will be casted only with a dot .)\nNAME=true =\u003e $_ENV['NAME'] = true\nNAME=false =\u003e $_ENV['NAME'] = false\nNAME=string value =\u003e $_ENV['NAME'] = 'string value'\n```\n\n###  Multiline variables are also available ! (separated by `\\n`), double quotes (`\"`) will be used\n\n```php\n    NAME=\"This is a variable\n    with\n    multiple\n    lines\"\n```\n\n### Nested variables, declared beforehand via the same file or `getenv()` (set via the OS or docker for example)\n\n```php\n    NESTED=VALUE\n    NAME=${NESTED}\n    NAME2=${NESTED}/path\n\n    $_ENV['NESTED'] = 'VALUE'\n    $_ENV['NAME'] = 'VALUE'\n    $_ENV['NAME2'] = 'VALUE/path'\n```\n\nThrow an `RayanLevert\\Dotenv\\Exception` if at least one variable is not present in the `$_ENV` superglobal\n\n```php\n$oDotenv-\u003erequired('FIRST_REQUIRED', 'SECOND_REQUIRED');\n```\n\nWorth if we want required variables for application purposes, an exception will be thrown to prevent some logic error\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayanlevert%2Fdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayanlevert%2Fdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayanlevert%2Fdotenv/lists"}