{"id":17037114,"url":"https://github.com/perryvw/phpvalvekv","last_synced_at":"2026-03-09T15:02:50.508Z","repository":{"id":56483065,"uuid":"94575888","full_name":"Perryvw/PHPValveKV","owner":"Perryvw","description":"A parser for Valve's KV format, written in PHP.","archived":false,"fork":false,"pushed_at":"2023-11-30T12:46:04.000Z","size":632,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T13:26:12.938Z","etag":null,"topics":["parser","php","serialization","valve"],"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/Perryvw.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,"zenodo":null}},"created_at":"2017-06-16T19:41:43.000Z","updated_at":"2023-09-08T18:52:51.000Z","dependencies_parsed_at":"2025-04-12T13:22:48.622Z","dependency_job_id":"3daff23a-7134-4298-91a1-c1a0f2578bf5","html_url":"https://github.com/Perryvw/PHPValveKV","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Perryvw/PHPValveKV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Perryvw%2FPHPValveKV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Perryvw%2FPHPValveKV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Perryvw%2FPHPValveKV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Perryvw%2FPHPValveKV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Perryvw","download_url":"https://codeload.github.com/Perryvw/PHPValveKV/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Perryvw%2FPHPValveKV/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263540979,"owners_count":23477454,"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":["parser","php","serialization","valve"],"created_at":"2024-10-14T08:52:55.023Z","updated_at":"2026-03-09T15:02:50.452Z","avatar_url":"https://github.com/Perryvw.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPValveKV\nA parser for Valve's KeyValue serialization format, written in PHP.\n\nThe parser supports parsing from files and strings. It can deal with most of the quirks of the Valve KV language such as conditionals, un-quoted keys or values, #base includes.\n\nThanks to [xPaw](https://github.com/xPaw) for his help and the [ValveKeyValue](https://github.com/SteamDatabase/ValveKeyValue) project for their testcases.\n\n# Typed version available\nThis library is available with typed properties on the [typed-at-php7.4](https://github.com/Perryvw/PHPValveKV/tree/typed-at-php7.4) branch. This version will only work with php version \u003e= 7.4!\n\n## Usage\n```php\nrequire \"valveKV.php\";\n\n// Create a parser instance.\n$parser = new \\ValveKV\\ValveKV();\n// Parse a KV string.\n$kvFromString = $parser-\u003eparseFromString('\"root\"{\"A\" \"B\"}');\n// Parse a KV file.\n$kvFromFile = $parser-\u003eparseFromFile(\"myKVFile.txt\");\n\n// Parse while merging the values of duplicate keys.\n$kvFromFile2 = $parser-\u003eparseFromFile(\"myKVFile.txt\", true);\n```\n\n### Duplicate keys\nThe KV format can contain duplicate keys. By default, the value of duplicate keys will be transformed into a list of its different values. The functions `parseFromString` and `parseFromFile` both have a flag `mergeDuplicates` that merges the values of duplicate keys (if they are arrays) instead of adding them to a list.\n\n## Test status\nCurrently the parser is covered by a large amount of test cases that all pass.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperryvw%2Fphpvalvekv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperryvw%2Fphpvalvekv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperryvw%2Fphpvalvekv/lists"}