{"id":19306328,"url":"https://github.com/kdl-org/kdl-php","last_synced_at":"2025-04-22T12:35:46.233Z","repository":{"id":50760478,"uuid":"325097850","full_name":"kdl-org/kdl-php","owner":"kdl-org","description":"A KDL parser for PHP.","archived":false,"fork":false,"pushed_at":"2023-08-08T14:45:11.000Z","size":48,"stargazers_count":13,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-19T11:50:58.555Z","etag":null,"topics":["kdl","parser"],"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/kdl-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-12-28T19:23:16.000Z","updated_at":"2024-06-02T12:43:08.000Z","dependencies_parsed_at":"2022-09-05T18:13:00.415Z","dependency_job_id":null,"html_url":"https://github.com/kdl-org/kdl-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdl-org%2Fkdl-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdl-org%2Fkdl-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdl-org%2Fkdl-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdl-org%2Fkdl-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdl-org","download_url":"https://codeload.github.com/kdl-org/kdl-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223897008,"owners_count":17221475,"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":["kdl","parser"],"created_at":"2024-11-10T00:05:35.265Z","updated_at":"2024-11-10T00:05:35.855Z","avatar_url":"https://github.com/kdl-org.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/kdl/kdl/v)](//packagist.org/packages/kdl/kdl) [![License](https://poser.pugx.org/kdl/kdl/license)](//packagist.org/packages/kdl/kdl) ![Status](https://github.com/kdl-org/kdl-php/workflows/Project%20checks/badge.svg?branch=main)\n\n# KDL-PHP\n\nA PHP library for the [KDL Document Language](https://kdl.dev) (pronounced like \"cuddle\").\n\n![alt text](./kdl.svg \"KDL logo\")\n\n## Installation\n\nThe KDL library can be included to your project using Composer:\n\n`composer require kdl/kdl`\n\n## Limitations\n\nFor now, this library only supports parsing.\n\nParsing a 45 line file with a tree depth of 5 is likely to take about 30ms currently - this speed is improving all the time with releases of the underlying parser library. This library favours correctness over performance - however, the aim is for parse speed to improve to a point of being reasonable.\n\nThe parser uses [Parsica](https://parsica.verraes.net/) as an underlying parsing library in order to map fairly directly and clearly onto the published KDL grammar - Parsica uses FP principles, and one result of this is that the call stack depth used during parsing may be high. Be warned if you are using e.g. xdebug, as parsing may exceed any normal maximum stack depth that you may set.\n\n## Examples\n\n```php\n$document = Kdl\\Kdl\\Kdl::parse($kdlString);\nforeach ($document as $node) {\n    $node-\u003egetName(); //gets the name for the node @see https://github.com/kdl-org/kdl/blob/main/SPEC.md#node\n    $node-\u003egetValues(); //gets a list of values for a node @see https://github.com/kdl-org/kdl/blob/main/SPEC.md#value\n    $node-\u003egetProperties(); //gets an associative array of properties @see https://github.com/kdl-org/kdl/blob/main/SPEC.md#property\n    foreach ($node-\u003egetChildren() as $child) {\n        $child-\u003egetName(); //name for the child\n       //etc\n    }\n}\n```\n\n## License\n\nThe code is available under the [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdl-org%2Fkdl-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdl-org%2Fkdl-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdl-org%2Fkdl-php/lists"}