{"id":22143212,"url":"https://github.com/thedragoncode/env-sync","last_synced_at":"2025-02-26T23:10:05.976Z","repository":{"id":37183340,"uuid":"333111450","full_name":"TheDragonCode/env-sync","owner":"TheDragonCode","description":"Keeping your .env.example is up to date","archived":true,"fork":false,"pushed_at":"2025-02-20T08:26:55.000Z","size":326,"stargazers_count":36,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T23:09:59.242Z","etag":null,"topics":[],"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/TheDragonCode.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://boosty.to/dragon-code","https://yoomoney.ru/to/410012608840929","https://www.donationalerts.com/r/dragon_code"]}},"created_at":"2021-01-26T14:32:11.000Z","updated_at":"2025-02-20T08:29:54.000Z","dependencies_parsed_at":"2023-12-17T20:32:31.730Z","dependency_job_id":"37d5fc7c-b996-474b-88b1-1eddad4fc961","html_url":"https://github.com/TheDragonCode/env-sync","commit_stats":{"total_commits":194,"total_committers":5,"mean_commits":38.8,"dds":0.3969072164948454,"last_synced_commit":"9812f667b87d98acadf0c2560569f5a23aa03610"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Fenv-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Fenv-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Fenv-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Fenv-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheDragonCode","download_url":"https://codeload.github.com/TheDragonCode/env-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947673,"owners_count":19883031,"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":[],"created_at":"2024-12-01T22:07:59.106Z","updated_at":"2025-02-26T23:10:05.965Z","avatar_url":"https://github.com/TheDragonCode.png","language":"PHP","funding_links":["https://boosty.to/dragon-code","https://yoomoney.ru/to/410012608840929","https://www.donationalerts.com/r/dragon_code"],"categories":[],"sub_categories":[],"readme":"# Environment Synchronization\n\n\u003cimg src=\"https://preview.dragon-code.pro/TheDragonCode/env-sync.svg?brand=php\" alt=\"Environment Synchronization\"/\u003e\n\n[![Stable Version][badge_stable]][link_packagist]\n[![Unstable Version][badge_unstable]][link_packagist]\n[![Total Downloads][badge_downloads]][link_packagist]\n[![Github Workflow Status][badge_build]][link_build]\n[![License][badge_license]][link_license]\n\n\u003e [!TIP]\n\u003e Use [msamgan/laravel-env-keys-checker](https://github.com/msamgan/laravel-env-keys-checker) instead.\n\n## Installation\n\n\u003e If you are using the Laravel framework, then install the [dragon-code/env-sync-laravel](https://github.com/TheDragonCode/env-sync-laravel) package instead.\n\n\nTo get the latest version of `Environment Synchronization`, simply require the project using [Composer](https://getcomposer.org):\n\n```bash\n$ composer require dragon-code/env-sync --dev\n```\n\nOr manually update `require-dev` block of `composer.json` and run `composer update`.\n\n```json\n{\n    \"require-dev\": {\n        \"dragon-code/env-sync\": \"^4.0\"\n    }\n}\n```\n\n## How to use\n\n\u003e This package scans files with `*.php`, `*.json`, `*.yml`, `*.yaml` and `*.twig` extensions in the specified folder, receiving from them calls to the `env` and `getenv` functions.\n\u003e Based on the received values, the package creates a key-value array. When saving, the keys are split into blocks by the first word before the `_` character.\n\u003e\n\u003e Also, all keys are sorted alphabetically.\n\n### Frameworks\n\n* Laravel / Lumen Frameworks - See the documentation in [this repository](https://github.com/TheDragonCode/env-sync-laravel).\n\n### Native using\n\nTo call a command in your application, you need to do the following:\n\n```php\nuse DragonCode\\EnvSync\\Services\\Syncer;\n\nprotected function syncer(): Syncer\n{\n    return Syncer::make();\n}\n\nprotected function sync()\n{\n    $this-\u003esyncer()\n       -\u003epath(__DIR__)\n       -\u003efilename('.env.example')\n       -\u003estore();\n}\n```\n\nIf you want to define default values or specify which key values should be stored, you need to pass an array to the constructor of the `Config` class:\n\n```php\nuse DragonCode\\EnvSync\\Services\\Syncer;\n\nprotected function syncer(): Syncer\n{\n    return Syncer::make($this-\u003econfig());\n}\n\nprotected function config(): array\n{\n    return require realpath(__DIR__ . '/your-path/your-config.php');\n}\n```\n\nYou can also suggest your implementation by sending a PR. We will be glad 😊\n\n\n## License\n\nThis package is licensed under the [MIT License](LICENSE).\n\n\n[badge_build]:          https://img.shields.io/github/actions/workflow/status/TheDragonCode/env-sync/symfony-6.yml?style=flat-square\n\n[badge_downloads]:      https://img.shields.io/packagist/dt/dragon-code/env-sync.svg?style=flat-square\n\n[badge_license]:        https://img.shields.io/packagist/l/dragon-code/env-sync.svg?style=flat-square\n\n[badge_stable]:         https://img.shields.io/github/v/release/TheDragonCode/env-sync?label=stable\u0026style=flat-square\n\n[badge_unstable]:       https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square\n\n[link_build]:           https://github.com/TheDragonCode/env-sync/actions\n\n[link_license]:         LICENSE\n\n[link_packagist]:       https://packagist.org/packages/dragon-code/env-sync\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedragoncode%2Fenv-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedragoncode%2Fenv-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedragoncode%2Fenv-sync/lists"}