{"id":17172838,"url":"https://github.com/wodcz/nette-dotenv","last_synced_at":"2025-07-08T04:05:49.960Z","repository":{"id":57081646,"uuid":"80570593","full_name":"wodCZ/nette-dotenv","owner":"wodCZ","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-30T13:11:18.000Z","size":24,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-03T08:58:03.617Z","etag":null,"topics":["environment-variables","nette","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/wodCZ.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":"2017-01-31T22:52:19.000Z","updated_at":"2023-08-16T22:37:12.000Z","dependencies_parsed_at":"2022-08-24T14:58:17.174Z","dependency_job_id":null,"html_url":"https://github.com/wodCZ/nette-dotenv","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wodCZ/nette-dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wodCZ%2Fnette-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wodCZ%2Fnette-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wodCZ%2Fnette-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wodCZ%2Fnette-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wodCZ","download_url":"https://codeload.github.com/wodCZ/nette-dotenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wodCZ%2Fnette-dotenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264192293,"owners_count":23570753,"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","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":["environment-variables","nette","php"],"created_at":"2024-10-14T23:48:00.919Z","updated_at":"2025-07-08T04:05:49.916Z","avatar_url":"https://github.com/wodCZ.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nette-dotenv\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![Total Downloads][ico-downloads]][link-downloads]\n\nThis little extension helps you to work with environment variables in config.neon.\nTo make it even more convenient, this extension also variables from `.env` file - a feature well known to Laravel users.\n\n## Install\n\nVia Composer\n\n```bash\n$ composer require wodcz/nette-dotenv\n```\n\nThen register extension in your `config.neon`\n```neon\nextensions:\n\tenv: wodCZ\\NetteDotenv\\DotEnvExtension\n```\n\n## Usage\n\nYou can access any environment variable using `@env.get('key', 'default')` syntax:\n\n```neon\nservices:\n    - App/MyConnection(@env::get('DB_HOST', '127.0.0.1'))\n```\n\nEnvironment variables are often set by a `docker`, `docker-compose`, or your CI server.\nTo make working with environment variables even easier, you can specify them in `.env` file\nin root directory of your application. \n\nThis file should be hidden from VCS using `.gitignore` or so,\nbecause each developer/server could require different environment configuration. \nFurthermore, having `.env` file with credentials in repository would be a security risk.\n\nThis is an example on how your `.env` file might look like:\n\n```\nDB_HOST=192.168.0.10\nDB_USER=myprojuser\nDB_NAME=myproj\nGOOGLE_API_KEY=my_own_key_used_for_development\n```\n\nHave a look at [vlucas/phpdotenv documentation](https://github.com/vlucas/phpdotenv) for more comprehensive examples.\n\n## Configuration\n\nYou can change behavior of this extension using `neon` configuration. Here is a list of available options with their\ndefault values.\n```neon\nenv:\n\tdirectory: \"%appDir%/../\"\n\tfileName: \".env\"\n\toverload: false\n\tlocalOnly: false\n\tprefix: false\n\tclass: \\wodCZ\\NetteDotenv\\EnvAccessor\n```\n\n| Option | Description |\n|--------|-------------|\n| `directory` | Where your `.env` file is located |\n| `fileName` | Name of your `.env` file |\n| `overload` | Whether options in the `.env` file should override existing environment variables |\n| `localOnly` | [Set to true to only return local environment variables (set by the operating system or putenv).](http://php.net/getenv#refsect1-function.getenv-parameters) |\n| `prefix` | Whether to prefix the service name with the extension name |\n| `class` | Class used to access environment variables |\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email admin@ikw.cz instead of using the issue tracker.\n\n## Credits\n\n- [Martin Janeček][link-author]\n- [Vašek Henzl](https://github.com/vhenzl)\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/wodCZ/nette-dotenv.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/wodCZ/nette-dotenv/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/wodCZ/nette-dotenv.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/wodCZ/nette-dotenv.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/wodCZ/nette-dotenv.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/wodCZ/nette-dotenv\n[link-travis]: https://travis-ci.org/wodCZ/nette-dotenv\n[link-scrutinizer]: https://scrutinizer-ci.com/g/wodCZ/nette-dotenv/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/wodCZ/nette-dotenv\n[link-downloads]: https://packagist.org/packages/wodCZ/nette-dotenv\n[link-author]: https://github.com/wodCZ\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwodcz%2Fnette-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwodcz%2Fnette-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwodcz%2Fnette-dotenv/lists"}