{"id":14966679,"url":"https://github.com/panlatent/yii2-dotenv","last_synced_at":"2026-03-03T02:32:12.592Z","repository":{"id":28099653,"uuid":"116243579","full_name":"panlatent/yii2-dotenv","owner":"panlatent","description":"PHP dotenv for Yii2 framework","archived":false,"fork":false,"pushed_at":"2022-10-11T13:27:14.000Z","size":20,"stargazers_count":40,"open_issues_count":5,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-17T13:23:22.160Z","etag":null,"topics":["php-dotenv","yii2-framework"],"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/panlatent.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":"2018-01-04T09:54:09.000Z","updated_at":"2025-09-20T00:06:26.000Z","dependencies_parsed_at":"2022-07-27T12:32:14.925Z","dependency_job_id":null,"html_url":"https://github.com/panlatent/yii2-dotenv","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/panlatent/yii2-dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panlatent%2Fyii2-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panlatent%2Fyii2-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panlatent%2Fyii2-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panlatent%2Fyii2-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panlatent","download_url":"https://codeload.github.com/panlatent/yii2-dotenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panlatent%2Fyii2-dotenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30030829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T00:31:48.536Z","status":"online","status_checked_at":"2026-03-03T02:00:07.650Z","response_time":61,"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":["php-dotenv","yii2-framework"],"created_at":"2024-09-24T13:36:47.557Z","updated_at":"2026-03-03T02:32:12.577Z","avatar_url":"https://github.com/panlatent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii2 DotEnv\n===========\n[![Build Status](https://github.com/panlatent/yii2-dotenv/actions/workflows/tests.yml/badge.svg)](https://github.com/panlatent/yii2-dotenv/actions/workflows/tests.yml)\n[![Latest Stable Version](https://poser.pugx.org/yiithings/yii2-dotenv/v/stable.svg)](https://packagist.org/packages/yiithings/yii2-dotenv) \n[![Total Downloads](https://poser.pugx.org/yiithings/yii2-dotenv/downloads.svg)](https://packagist.org/packages/yiithings/yii2-dotenv) \n[![Latest Unstable Version](https://poser.pugx.org/yiithings/yii2-dotenv/v/unstable.svg)](https://packagist.org/packages/yiithings/yii2-dotenv)\n[![License](https://poser.pugx.org/yiithings/yii2-dotenv/license.svg)](https://packagist.org/packages/yiithings/yii2-dotenv)\n\nPHP DotEnv for Yii2 framework.\n\nInstallation\n------------\nThen tell [Composer](https://getcomposer.org) to load the extension:\n\n```bash\ncomposer require yiithings/yii2-dotenv\n```\n\nConfiguration\n------------\nThe extension default load environment variables from `.env` file in your application root directory. You can change \nthe file path and name configure in your application entry file:\n\n```php\ndefine('DOTENV_PATH', '/path/to/.env');\ndefine('DOTENV_FILE', '.env');\ndefine('DOTENV_OVERLOAD', false);\n```\n\nUsage\n-----\nOnce the extension is installed, simply use it in your code by  :\n```\n[\n    'db' =\u003e [\n        'username' =\u003e env('DB_USERNAME', 'root'),\n        'password' =\u003e env('DB_PASS'),\n    ],\n]\n```\n\nThe env function will autoload .env file, it uses the following search mechanism:\n\n    If there is a Yii class, then pass the alias @vendor or @app or @yii, Otherwise \n    according to the project directory to determine.\n    \nBut, if your application vendor directory is a symbol link and you no registered\n@vendor or @app alias before call env function, the project will not working. So\nyou should set the @vendor alias before calling env function.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanlatent%2Fyii2-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanlatent%2Fyii2-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanlatent%2Fyii2-dotenv/lists"}