{"id":15089536,"url":"https://github.com/vmassalov/config","last_synced_at":"2026-02-05T09:36:38.756Z","repository":{"id":223954665,"uuid":"748365140","full_name":"vmassalov/config","owner":"vmassalov","description":"Configuration service","archived":false,"fork":false,"pushed_at":"2024-02-23T15:25:51.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T14:40:39.339Z","etag":null,"topics":["config","yaml"],"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/vmassalov.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}},"created_at":"2024-01-25T20:23:36.000Z","updated_at":"2024-02-22T21:53:48.000Z","dependencies_parsed_at":"2024-11-27T20:40:18.461Z","dependency_job_id":null,"html_url":"https://github.com/vmassalov/config","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"3b25d713ad71ac6c5ac5e47b23b36def36389ee6"},"previous_names":["vmassalov/config"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vmassalov/config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmassalov%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmassalov%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmassalov%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmassalov%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmassalov","download_url":"https://codeload.github.com/vmassalov/config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmassalov%2Fconfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266944896,"owners_count":24010490,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["config","yaml"],"created_at":"2024-09-25T09:00:44.277Z","updated_at":"2026-02-05T09:36:38.726Z","avatar_url":"https://github.com/vmassalov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Config\n\nLibrary for matching rulesets based on file configs\n\nThe main goal of this package is to move out endless sequences of business logic 'elseif' outside of the code. It can be mapping exception classes to error codes, discount calculation rules, or any other strategy conditions. All conditions that do not change often enough and are not worth putting in the database can be conveniently transferred to the configs.\n\n## Install\n\nVia composer\n```shell\ncomposer require vmassalov/config\n```\n\n## Quick usage\nCreate yaml config file, e.g.:\n```yaml\n- conditions:\n    dayOfWeek:\n      - monday\n      - tuesday\n      - wednesday\n      - thursday\n      - friday\n    projectPriority:\n      - normal\n      - minor\n  result:\n    salaryRate: 1\n    needOvertimeApprove: true\n\n- conditions:\n    dayOfWeek:\n      - monday\n      - tuesday\n      - wednesday\n      - thursday\n      - friday\n    projectPriority: critical\n  result:\n    salaryRate: 1\n    needOvertimeApprove: false\n\n- conditions:\n    projectPriority: critical\n  result:\n    salaryRate: 2\n    needOvertimeApprove: false\n```\nAll result blocks should contain same keys. All condition block can contain a different keys with single or multiple options.\n```php\n$configClient = \\VMassalov\\Config\\ClientFactory::build('filesystem://./path/to/configs');\n$configClient-\u003efind(\n    'config.yaml',\n    [\n        'dayOfWeek' =\u003e 'sunday',\n        'projectPriority' =\u003e 'critical',\n    ],\n);\n```\nClient will return a result of first full match item based on passed criteria\n## Configuration\n### DSN\nfilesystem://\n### Config syntax\nSee examples in tests/functional/stubs/yaml/baseConfig.yaml\n## Test\nRun unit and functional test in docker\n```shell\nmake build \u0026\u0026 make test\n```\nRun unit and functional test locally\n```shell\nphp ./vendor/bin/phpunit\n```\n## Roadmap\n* [ ] Add JSON support\n* [ ] Add XML support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmassalov%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmassalov%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmassalov%2Fconfig/lists"}