{"id":21714065,"url":"https://github.com/rstgroup/zf-local-config-module","last_synced_at":"2025-03-20T19:20:08.511Z","repository":{"id":62537853,"uuid":"98186758","full_name":"rstgroup/zf-local-config-module","owner":"rstgroup","description":null,"archived":false,"fork":false,"pushed_at":"2017-07-26T09:24:29.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-01-25T17:29:06.901Z","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/rstgroup.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":"2017-07-24T12:09:40.000Z","updated_at":"2017-07-25T09:37:19.000Z","dependencies_parsed_at":"2022-11-02T15:16:40.582Z","dependency_job_id":null,"html_url":"https://github.com/rstgroup/zf-local-config-module","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Fzf-local-config-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Fzf-local-config-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Fzf-local-config-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstgroup%2Fzf-local-config-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstgroup","download_url":"https://codeload.github.com/rstgroup/zf-local-config-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244676451,"owners_count":20491828,"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-11-26T00:30:39.645Z","updated_at":"2025-03-20T19:20:08.486Z","avatar_url":"https://github.com/rstgroup.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZF Local Config Module\n\nThis module allows you to dynamically adjust configuration of your application via command-line interface.\n\n## Installation\n\nRequire module with Composer:\n\n```bash\ncomposer require rstgroup/zf-local-config-module\n```\n\nThe next step is adding module to ZF system configuration (`config/application.config.php`):\n```php\nreturn [\n    'modules' =\u003e [\n        (...),\n        'RstGroup\\ZfLocalConfigModule',\n    ],\n    (...)\n]\n```\n\n... and providing the required configuration in your application's config:\n\n```php\nreturn [\n    'rst_group' =\u003e [\n        'local_config' =\u003e [\n            'filename' =\u003e 'config/autoload/dynamic-config.local.php'\n        ],\n    ],\n];\n```\n\n## Usage\n\nThe module provides command-line commands to help managing local, dynamically generated, application configuration.\n\n### Setting configuration\n\nSetting configuration is as simple as writing the line:\n\n```bash\nphp public/index.php local-config set path.to.value string-value\n```\n\nThis will result in writing the code into `config/autoload/dynamic-config.local.php` file:\n```php\nreturn [\n    'path' =\u003e [\n        'to' =\u003e [\n            'value' =\u003e 'string-value'\n        ],\n    ],\n];\n```\n\nBy default, all values passed via command line are treated as strings. To set value of any simple type, you can use JSON\nnotation. To enable it, just add `--json` flag. \n\nLook at some of the examples below:\n\n```bash\n# setting a number\nphp public/index.php local-config set path.to.value 1234 --json\n# setting null\nphp public/index.php local-config set path.to.value null --json\n```\n\nJSON notation can also be used to set a structure or an array in given path:\n\n```bash\n# setting an array\nphp public/index.php local-config set array \"[1,2,3,4]\" --json\n# setting complex structure\nphp public/index.php local-config set structure '{\"complex\":{\"structure\":{\"x\":\"y\"},\"x\":null}}' --json\n```\n\nThe result of these two commands ran one after another would be a `config/autoload/dynamic-config.local.php` file like:\n\n```php\nreturn [\n    'array' =\u003e [ 1, 2, 3, 4 ],\n    'complex' =\u003e [\n        'structure' =\u003e [\n            'x' =\u003e 'y'\n        ],\n        'x' =\u003e null,\n    ],\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstgroup%2Fzf-local-config-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstgroup%2Fzf-local-config-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstgroup%2Fzf-local-config-module/lists"}