{"id":15068596,"url":"https://github.com/quillstack/dotenv","last_synced_at":"2026-02-06T05:32:01.433Z","repository":{"id":45128303,"uuid":"303510748","full_name":"quillstack/dotenv","owner":"quillstack","description":"The library to use .env files in your project.","archived":false,"fork":false,"pushed_at":"2022-01-14T10:07:52.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-01T16:57:47.662Z","etag":null,"topics":["dotenv","env","environment","php","php8","quillstack"],"latest_commit_sha":null,"homepage":"https://quillstack.org/dotenv","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quillstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-12T20:54:06.000Z","updated_at":"2022-01-06T20:59:28.000Z","dependencies_parsed_at":"2022-08-25T23:01:57.205Z","dependency_job_id":null,"html_url":"https://github.com/quillstack/dotenv","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/quillstack/dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quillstack","download_url":"https://codeload.github.com/quillstack/dotenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fdotenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29152426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["dotenv","env","environment","php","php8","quillstack"],"created_at":"2024-09-25T01:38:27.437Z","updated_at":"2026-02-06T05:32:01.411Z","avatar_url":"https://github.com/quillstack.png","language":"PHP","readme":"# Quillstack Dotenv\n\n[![Build Status](https://app.travis-ci.com/quillstack/dotenv.svg?branch=main)](https://app.travis-ci.com/quillstack/dotenv)\n[![Downloads](https://img.shields.io/packagist/dt/quillstack/dotenv.svg)](https://packagist.org/packages/quillstack/dotenv)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=quillstack_dotenv\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=quillstack_dotenv)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=quillstack_dotenv\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=quillstack_dotenv)\n[![StyleCI](https://github.styleci.io/repos/303510748/shield?branch=main)](https://github.styleci.io/repos/303510748?branch=main)\n[![CodeFactor](https://www.codefactor.io/repository/github/quillstack/dotenv/badge)](https://www.codefactor.io/repository/github/quillstack/dotenv)\n![Packagist License](https://img.shields.io/packagist/l/quillstack/dotenv)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=quillstack_dotenv\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=quillstack_dotenv)\n[![Maintainability](https://api.codeclimate.com/v1/badges/df220a266c66f5b4c19c/maintainability)](https://codeclimate.com/github/quillstack/dotenv/maintainability)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=quillstack_dotenv\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=quillstack_dotenv)\n![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/quillstack/dotenv)\n\nThe library for using `.env` files. You can find the full documentation on the website: \\\nhttps://quillstack.org/dotenv\n\nThe `.env` should be used for sensitive information like passwords, hosts, keys, credentials, and all other values that \ncan be changed depending on the environment, e.g., debug mode settings or logs level. \n\n### Installation\n\nTo install this package, run the standard command using _Composer_:\n\n```shell\ncomposer require quillstack/dotenv\n```\n\n### Usage\n\nYou can use Quillstack Dotenv package when you want to use `.env` files in your project.\n\n#### Simple usage\n\nIf you created the `.env` file in the root directory of your proejct:\n\n```shell\nAPP_DEBUG=true\n```\n\nYou can load this `.env` file in your application:\n\n```php\n$dotenv = new Dotenv('.env');\n$dotenv-\u003eload();\n```\n\nEvery time you need to know if your application works in debug mode, you can check it using this helper function:\n\n```php\nif (env('APP_DEBUG')) {\n    echo 'Debug mode';\n}\n```\n\n#### Default values\n\nYou can also define a default value depending on the context:\n\n```php\nif (env('APP_DEBUG', false)) {\n    echo 'Debug mode';\n}\n```\n\n#### Required keys\n\nYou can use another helper method for required keys. If required key is not found\nan exception will be thrown:\n\n```php\n$dbHost = required('DATABASE_HOST');\n```\n\nThe result if the key `DATABASE_HOST` is not set in the `.env` file:\n\n```text\nDotenvValueNotSetException:\nValue not set for key: DATABASE_HOST\n```\n\n#### Multi-line values\n\nYou can define multi-line values in your `.env` file by using `\\n` separator instead of new lines for example:\n\n```text\nPRIVATE_KEY=\"line1\\nline2\\nline3\"\n```\n\n### Unit tests\nRun tests using a command:\n\n```shell\nphpdbg -qrr ./vendor/bin/unit-tests\n```\n\n### Docker\n\n```shell\n$ docker-compose up -d\n$ docker exec -w /var/www/html -it quillstack_dotenv sh\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquillstack%2Fdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquillstack%2Fdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquillstack%2Fdotenv/lists"}