{"id":48800588,"url":"https://github.com/markhadjar/dotenv","last_synced_at":"2026-04-15T03:01:17.463Z","repository":{"id":351190793,"uuid":"1208167451","full_name":"markhadjar/dotenv","owner":"markhadjar","description":"Loads environment variables to $_ENV from .env file.","archived":false,"fork":false,"pushed_at":"2026-04-13T23:59:53.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"1.x","last_synced_at":"2026-04-14T02:19:29.775Z","etag":null,"topics":["dotenv","env","environment"],"latest_commit_sha":null,"homepage":"","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/markhadjar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"buy_me_a_coffee":"markhadjar"}},"created_at":"2026-04-11T23:00:40.000Z","updated_at":"2026-04-13T23:54:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/markhadjar/dotenv","commit_stats":null,"previous_names":["markhadjar/dotenv"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/markhadjar/dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markhadjar%2Fdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markhadjar%2Fdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markhadjar%2Fdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markhadjar%2Fdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markhadjar","download_url":"https://codeload.github.com/markhadjar/dotenv/tar.gz/refs/heads/1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markhadjar%2Fdotenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31824118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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"],"created_at":"2026-04-14T02:00:34.486Z","updated_at":"2026-04-15T03:01:17.424Z","avatar_url":"https://github.com/markhadjar.png","language":"PHP","funding_links":["https://buymeacoffee.com/markhadjar"],"categories":[],"sub_categories":[],"readme":"# Dotenv\n\nLoads environment variables to `$_ENV` from `.env` file.\n\n## Why Dotenv?\n\nAn application typically deploys to multiple environments, each requiring different configuration. Storing credentials directly in the codebase puts sensitive data into version control and makes switching between environments error-prone.\n\nDotenv loads configuration from a `.env` file into `$_ENV` at runtime. Because each environment uses its own `.env` with the appropriate values, the code does not need to change and credentials stay out of version control. This provides a portable way to manage environment variables across different runtimes without needing to modify server-level configuration files.\n\n## Requirements\n\nPHP 8.4+\n\n## Installation\n\nInstall via Composer:\n\n```bash\ncomposer require markhadjar/dotenv\n```\n\n## Usage\n\nThe `.env` file is generally kept out of version control since it can contain sensitive values such as API keys and passwords.\n\nCreate a `.env` file in your project root and add it to your `.gitignore` to keep it out of version control:\n\n```shell\nS3_BUCKET=your-bucket-name\nSECRET_KEY=your-secret-key\n```\n\nCreate a `.env.example` file and commit this to version control. The purpose is to let developers know what variables are required without exposing the real values. Variables should be left blank or set to dummy data:\n\n```shell\nS3_BUCKET=dev-bucket\nSECRET_KEY=P@ssword1\n```\n\nLoad the environment variables in your application:\n\n```php\n$dotenv = new \\MarkHadjar\\Dotenv\\Dotenv(__DIR__);\n$dotenv-\u003eload();\n```\n\nAccess your configuration values via `$_ENV`:\n\n```php\n$s3Bucket = $_ENV['S3_BUCKET'];\n$secretKey = $_ENV['SECRET_KEY'];\n```\n\n**Note:** Variables already present in `$_ENV` will not be overwritten by the `.env` file. If the `.env` file is not found or cannot be read, an exception will be thrown.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkhadjar%2Fdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkhadjar%2Fdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkhadjar%2Fdotenv/lists"}