{"id":21544349,"url":"https://github.com/railken/dotenv","last_synced_at":"2025-03-18T00:09:52.722Z","repository":{"id":62532811,"uuid":"163191030","full_name":"railken/dotenv","owner":"railken","description":"This library is an extension of vlucas/phpdotenv that grants you the ability to update variables into the `.env` file. You can either update, append or remove a variable.","archived":false,"fork":false,"pushed_at":"2018-12-27T17:36:22.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T08:44:23.008Z","etag":null,"topics":["dotenv","env","environment","file","persist","put","set","setter","store","update"],"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/railken.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-12-26T15:01:10.000Z","updated_at":"2019-07-10T13:05:59.000Z","dependencies_parsed_at":"2022-11-02T16:01:12.385Z","dependency_job_id":null,"html_url":"https://github.com/railken/dotenv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Fdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Fdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Fdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Fdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/railken","download_url":"https://codeload.github.com/railken/dotenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130281,"owners_count":20402756,"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":["dotenv","env","environment","file","persist","put","set","setter","store","update"],"created_at":"2024-11-24T05:17:46.680Z","updated_at":"2025-03-18T00:09:52.706Z","avatar_url":"https://github.com/railken.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotenv\n\n[![Build Status](https://travis-ci.org/railken/dotenv.svg?branch=master)](https://travis-ci.org/railken/dotenv)\n\nThis library is an extension of [Dotenv](https://github.com/vlucas/phpdotenv) that grants you the ability to update variables into the `.env` file.\nYou can either update, append or remove a variable.\n\n# Requirements\n\nPHP 7.1 and later.\n\n## Installation\n\nYou can install it via [Composer](https://getcomposer.org/) by typing the following command:\n\n```bash\ncomposer require railken/dotenv\n```\n\n## Usage\n\nA simple usage looks like: \n\n```php\nuse Railken\\Dotenv\\Dotenv;\n\n// Location of the directory that contains the .env file\n$path = __DIR__; \n\n$dotenv = new Dotenv($path);\n$dotenv-\u003eload();\n\n$dotenv-\u003eupdateVariable(\"APP_KEY\", \"foo\");\n$dotenv-\u003eappendVariable(\"NEW_KEY\", 2);\n$dotenv-\u003eremoveVariable(\"NEW_KEY\");\n```\n\nThe class `Railken\\Dotenv\\Dotenv` simply extends the class `Dotenv\\Dotenv` as you can see [here](https://github.com/railken/dotenv/blob/master/src/Dotenv.php#L7)\n\nIf you wish you can use directly the `Railken\\Dotenv\\Storage`\n\n```php\nuse Railken\\Dotenv\\Storage;\n\n// Location of the directory that contains the .env file\n$path = __DIR__; \n\n$storage = new Storage($path);\n$storage-\u003eupdate(\"APP_KEY\", \"foo\");\n$storage-\u003eappend(\"NEW_KEY\", 2);\n$storage-\u003eremove(\"NEW_KEY\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailken%2Fdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailken%2Fdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailken%2Fdotenv/lists"}