{"id":16592856,"url":"https://github.com/honzabrecka/transit-php","last_synced_at":"2025-03-21T13:31:36.431Z","repository":{"id":56985659,"uuid":"44888347","full_name":"honzabrecka/transit-php","owner":"honzabrecka","description":"Transit for PHP","archived":false,"fork":false,"pushed_at":"2023-11-21T08:54:48.000Z","size":66,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T01:51:16.275Z","etag":null,"topics":["format","php","transit"],"latest_commit_sha":null,"homepage":"http://transit-format.org","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/honzabrecka.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":"2015-10-24T23:00:59.000Z","updated_at":"2024-05-21T10:41:36.000Z","dependencies_parsed_at":"2024-10-28T10:27:40.800Z","dependency_job_id":"6252af84-45f1-4c4a-acdf-b0d53b402614","html_url":"https://github.com/honzabrecka/transit-php","commit_stats":{"total_commits":42,"total_committers":2,"mean_commits":21.0,"dds":0.04761904761904767,"last_synced_commit":"3e474988d85395bf76adf1177fc6be43711496f1"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Ftransit-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Ftransit-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Ftransit-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Ftransit-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honzabrecka","download_url":"https://codeload.github.com/honzabrecka/transit-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806108,"owners_count":20513382,"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":["format","php","transit"],"created_at":"2024-10-11T23:22:40.840Z","updated_at":"2025-03-21T13:31:36.129Z","avatar_url":"https://github.com/honzabrecka.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# transit-php\n\nTransit is a data format and a set of libraries for conveying values between applications written in different languages. This library provides support for marshalling Transit data to/from PHP. Unlike the Java and Clojure implementations it relies on the non-streaming JSON parsing mechanism of the host PHP environment.\n\n* [Rationale](http://blog.cognitect.com/blog/2014/7/22/transit)\n* [Specification](http://github.com/cognitect/transit-format)\n\nThis implementation's major.minor version number corresponds to the version of\nthe Transit specification it supports.\n\n_NOTE: Transit is a work in progress and may evolve based on feedback.\nAs a result, while Transit is a great option for transferring data\nbetween applications, it should not yet be used for storing data\ndurably over time. This recommendation will change when the\nspecification is complete._\n\n## Installation\n\n```\ncomposer require honzabrecka/transit-php\n```\n\n## Usage\n\n```php\nuse transit\\JSONReader;\nuse transit\\JSONWriter;\nuse transit\\Transit;\nuse transit\\Map;\n\n$transit = new Transit(new JSONReader(), new JSONWriter());\n$transit-\u003eread('[\"^ \",\"foo\",\"bar\"]');\n$transit-\u003ewrite(new Map(['foo', 'bar']));\n```\n\nYou can use assoc array instead of transit\\Map. It comes with a price (string keys only), therefore it's disabled by default.\n\n```php\nuse transit\\JSONReader;\nuse transit\\JSONWriter;\nuse transit\\Transit;\n\n$transit = new Transit(new JSONReader(true), new JSONWriter(true));\n$transit-\u003eread('[\"^ \",\"foo\",\"bar\"]');\n$transit-\u003ewrite(['foo' =\u003e 'bar']);\n```\n\n## Default Type Mapping\n\n|Transit type|Write accepts|Read returns|\n|------------|-------------|------------|\n|null|null|null|\n|string|string|string|\n|boolean|bool|bool|\n|integer|int|int|\n|decimal|float|float|\n|bytes|transit\\Bytes|transit\\Bytes|\n|keyword|transit\\Keyword|transit\\Keyword|\n|symbol|transit\\Symbol|transit\\Symbol|\n|time|DateTime|DateTime|\n|array|array|array|\n|map|transit\\Map or assoc array|transit\\Map or assoc array|\n|cmap|transit\\CMap|transit\\CMap|\n|set|transit\\Set|transit\\Set|\n|list|SplDoublyLinkedList|SplDoublyLinkedList|\n|uri|transit\\URI|transit\\URI|\n|uuid|transit\\UUID|transit\\UUID|\n|char|transit\\Char|transit\\Char|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzabrecka%2Ftransit-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonzabrecka%2Ftransit-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzabrecka%2Ftransit-php/lists"}