{"id":31715018,"url":"https://github.com/linna/dotenv","last_synced_at":"2025-10-09T01:51:04.587Z","repository":{"id":57015286,"uuid":"145428565","full_name":"linna/dotenv","owner":"linna","description":"Set environment variables from .env file","archived":false,"fork":false,"pushed_at":"2022-02-20T19:09:11.000Z","size":40,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T06:43:38.487Z","etag":null,"topics":["dotenv","env","php"],"latest_commit_sha":null,"homepage":null,"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/linna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-20T14:28:04.000Z","updated_at":"2022-02-19T16:52:46.000Z","dependencies_parsed_at":"2022-08-22T09:30:21.911Z","dependency_job_id":null,"html_url":"https://github.com/linna/dotenv","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/linna/dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linna","download_url":"https://codeload.github.com/linna/dotenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fdotenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000705,"owners_count":26082894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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","php"],"created_at":"2025-10-09T01:50:26.259Z","updated_at":"2025-10-09T01:51:04.579Z","avatar_url":"https://github.com/linna.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"logo-linna-96.png\" alt=\"Linna Logo\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"logo-dotenv.png\" alt=\"Linna dotenv Logo\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \n[![Tests](https://github.com/linna/dotenv/actions/workflows/tests.yml/badge.svg)](https://github.com/linna/dotenv/actions/workflows/tests.yml)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/linna/dotenv/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/linna/dotenv/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/linna/dotenv/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/linna/dotenv/?branch=master)\n[![StyleCI](https://github.styleci.io/repos/145428565/shield?branch=master\u0026style=flat)](https://github.styleci.io/repos/145428565)\n[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat)](https://github.com/php-pds/skeleton)\n[![PHP 7.2](https://img.shields.io/badge/PHP-7.2-8892BF.svg)](http://php.net)\n\n\u003c/div\u003e\n\n# About\nThis package provide a way to load .env files values as environement variable, it was insiperd by [nodejs counterpart](https://github.com/motdotla/dotenv).\n\n## Requirements\nThis package require php 7.2\n\n## Installation\nWith composer:\n```\ncomposer require linna/dotenv\n```\n\n## Usage\n.env.test file as example\n```\nAPP=linna\nAPP_ENV=production\nUSER=user.name@linna.tools\nFOO=foo\nBAR=bar\nBAZ=baz\n```\n\nphp code for get above values\n```php\n$env = new Linna\\DotEnv\\DotEnv();\n$env-\u003eload('.env.test');\n\n$app = $env-\u003eget('APP');\n$app_env = $env-\u003eget('APP_ENV');\n\n//string 'linna' (length=5)\nvar_dump($app);\n\n//string 'production' (length=10)\nvar_dump($app_env);\n```\n\nenvironment information in phpinfo()\n```php\nphpinfo(INFO_ENVIRONMENT);\n```\n\n![phpinfo(INFO_ENVIRONMENT)](dotenv-screen.png)\n\n## Notes\nDotEnv class use php function [getenv](http://php.net/manual/en/function.getenv.php) and [putenv](http://php.net/manual/en/function.putenv.php) then \nkey and values will not be loaded in `$_ENV` superglobal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinna%2Fdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinna%2Fdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinna%2Fdotenv/lists"}