{"id":20426663,"url":"https://github.com/bckp/environment-adapter","last_synced_at":"2026-04-21T04:02:00.040Z","repository":{"id":210749095,"uuid":"727371381","full_name":"bckp/environment-adapter","owner":"bckp","description":"Simple bckp/environment adapter for Nette framework","archived":false,"fork":false,"pushed_at":"2023-12-04T18:44:49.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T14:43:06.034Z","etag":null,"topics":[],"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/bckp.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,"governance":null}},"created_at":"2023-12-04T18:24:40.000Z","updated_at":"2023-12-04T18:25:23.000Z","dependencies_parsed_at":"2023-12-04T19:50:40.846Z","dependency_job_id":null,"html_url":"https://github.com/bckp/environment-adapter","commit_stats":null,"previous_names":["bckp/environment-adapter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bckp/environment-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bckp%2Fenvironment-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bckp%2Fenvironment-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bckp%2Fenvironment-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bckp%2Fenvironment-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bckp","download_url":"https://codeload.github.com/bckp/environment-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bckp%2Fenvironment-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32076295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: 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":[],"created_at":"2024-11-15T07:17:12.811Z","updated_at":"2026-04-21T04:02:00.025Z","avatar_url":"https://github.com/bckp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://heatbadger.now.sh/github/readme/bckp/environment-adapter/)\n\n# Bckp/Environment-adapter\nAdapter for Nette so you can use *.env config files.\n\n[![Coverage Status](https://img.shields.io/coveralls/github/bckp/environment-adapter/master)](https://coveralls.io/github/bckp/environment-adapter?branch=master)\n[![Build Status](https://img.shields.io/github/workflow/status/bckp/environment-adapter/Tests/master)](https://github.com/bckp/environment-adapter/actions)\n[![Downloads this Month](https://img.shields.io/packagist/dm/bckp/environment-adapter.svg)](https://packagist.org/packages/bckp/environment-adapter)\n[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/quality/g/bckp/environment-adapter/master)](https://scrutinizer-ci.com/g/bckp/environment-adapter/?branch=master)\n[![Latest stable](https://img.shields.io/packagist/v/bckp/environment-adapter.svg)](https://packagist.org/packages/bckp/environment-adapter)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bckp/environment-adapter/blob/master/license.md)\n\nInstallation\n------------\n\nThe best way to install Bckp/Environment-adapter is using [Composer](http://getcomposer.org/):\n\n```sh\n$ composer require bckp/environment-adapter\n```\n\n## Development\n\nThis package is currently maintaining by these authors.\n\n\u003ca href=\"https://github.com/bckp\"\u003e\u003cimg width=\"80\" height=\"80\" src=\"https://avatars.githubusercontent.com/u/179652?v=4\u0026s=80\"\u003e\u003c/a\u003e\n\n## How to use\n\nFor use this adapter, you need to use Bckp/Configurator instead of Nette one. It will autoregister ENV extension support. After that, you can simply link `some-name.env` file and nette will inject env variables into %env%.\nThe expected syntax is\nname_of_env_variable: ::{string|int|float|bool}(default: {string}, hidden: {true|false})\nname_of_array_variable: ::array(separator: {string}, hidden: {true|false}, cast: {int|float|bool|string})\n\nfirst entry is name of ENV variable, this will add `%env.name_of_env_variable%` to the parameters and get value using `getenv('NAME_OF_ENV_VARIABLE');` \nnext is `::` that will tell adapter, we are working with entity, this is just shortcut to force nette get arguments using internal mechanism.\nafter that, we have `cast` part, this tells adapter, what type of variable he should cast to, usefull as env know only strings, with this, you can have INTs, FLOATs, BOOLs and even ARRAY of INT, FLOAT, STRING, BOOL.\n\nattributes inside\n```text\ndefault: that is fallback, if no value is found using getenv.\nhidden: if variable must remain secret, or we can burn it into generated container file (if we have password, we do not want to have it stored in PHP file, but kept it in ENV only)\ncast: only for Array, cast values to specific type\nseparator: only for Array, used for explode\n```\n\nif you keep order of arguments same as Environment class expect, you can omit their names.\n\n### Example file\n```text\nservice_user: ::string(secret_user)\nservice_password: ::string(secret_password, true)\nservice_port: ::int(1234)\nservice_nonstring: ::nonstring(1234)\nservice_active: ::bool(\\'false\\')\nservice_array: ::array(cast: int)\n```\nwith .env\n```text\nSERVICE_USER=someuser\nSERVICE_PASSWORD=supersecret\nSERVICE_ARRAY=1|2|3|4\n```\n\nwill be translated to if none ENV \n\n```php\n[\n\t'service_user' =\u003e 'someuser',\n\t'service_password' =\u003e Bckp\\Environment::string('SERVICE_PASSWORD', 'secret_password'),\n\t'service_port' =\u003e 1234,\n\t'service_nonstring' =\u003e '1234',\n\t'service_active' =\u003e false # notice string false is translated to the boolean correctly\n\t'service_array' =\u003e [1,2,3,4],\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbckp%2Fenvironment-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbckp%2Fenvironment-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbckp%2Fenvironment-adapter/lists"}