{"id":18408955,"url":"https://github.com/msgpack/msgpack-php","last_synced_at":"2025-05-16T07:07:47.127Z","repository":{"id":4345200,"uuid":"5481147","full_name":"msgpack/msgpack-php","owner":"msgpack","description":"msgpack.org[PHP]","archived":false,"fork":false,"pushed_at":"2024-09-26T08:33:35.000Z","size":966,"stargazers_count":787,"open_issues_count":20,"forks_count":118,"subscribers_count":64,"default_branch":"master","last_synced_at":"2025-05-14T04:12:35.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msgpack.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":"2012-08-20T12:52:29.000Z","updated_at":"2025-05-13T03:07:48.000Z","dependencies_parsed_at":"2024-11-29T02:15:15.956Z","dependency_job_id":null,"html_url":"https://github.com/msgpack/msgpack-php","commit_stats":{"total_commits":373,"total_committers":31,"mean_commits":12.03225806451613,"dds":0.6246648793565683,"last_synced_commit":"f51073404517406dfbc9f8bfc57e7fb9c4720029"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgpack%2Fmsgpack-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgpack%2Fmsgpack-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgpack%2Fmsgpack-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgpack%2Fmsgpack-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msgpack","download_url":"https://codeload.github.com/msgpack/msgpack-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485065,"owners_count":22078767,"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-06T03:22:47.183Z","updated_at":"2025-05-16T07:07:42.118Z","avatar_url":"https://github.com/msgpack.png","language":"PHP","readme":"# Msgpack for PHP\n[![Build Status](https://github.com/msgpack/msgpack-php/workflows/ci/badge.svg?branch=master)](https://github.com/msgpack/msgpack-php/actions?query=workflow%3Aci+branch%3Amaster)\n\nThis extension provides an API for communicating with MessagePack serialization.\n\nMessagePack is a binary-based efficient object serialization library.\nIt enables to exchange structured objects between many languages just like JSON.\nBut unlike JSON, it is very fast and small.\n\n## Requirement\n- PHP 7.0 +\n\n## Install\n\n### Install from PECL\nMsgpack is a PECL extension, thus you can simply install it by:\n\n```shell\npecl install msgpack\n```\n\n### Compile Msgpack from source\n\n```shell\n/path/to/phpize\n./configure --with-php-config=/path/to/php-config\nmake \u0026\u0026 make install\n```\n\n### Example\n```php\n\u003c?php\n$data = array(0 =\u003e 1, 1 =\u003e 2, 2 =\u003e 3);\n$msg = msgpack_pack($data);\n$data = msgpack_unpack($msg);\n```\n\n### Advanced Example\n```php\n\u003c?php\n$data = array(0 =\u003e 1, 1 =\u003e 2, 2 =\u003e 3);\n$packer = new \\MessagePack(false);\n// ^ same as $packer-\u003esetOption(\\MessagePack::OPT_PHPONLY, false);\n$packed = $packer-\u003epack($data);\n\n$unpacker = new \\MessagePackUnpacker(false);\n// ^ same as $unpacker-\u003esetOption(\\MessagePack::OPT_PHPONLY, false);\n$unpacker-\u003efeed($packed);\n$unpacker-\u003eexecute();\n$unpacked = $unpacker-\u003edata();\n$unpacker-\u003ereset();\n```\n\n### Advanced Streaming Example\n```php\n\u003c?php\n$data1 = array(0 =\u003e 1, 1 =\u003e 2, 2 =\u003e 3);\n$data2 = array(\"a\" =\u003e 1, \"b\" =\u003e 2, \"c\" =\u003e 3);\n\n$packer = new \\MessagePack(false);\n$packed1 = $packer-\u003epack($data1);\n$packed2 = $packer-\u003epack($data2);\n\n$unpacker = new \\MessagePackUnpacker(false);\n$buffer = \"\";\n$nread = 0;\n\n//Simulating streaming data :)\n$buffer .= $packed1;\n$buffer .= $packed2;\n\nwhile(true) {\n   if($unpacker-\u003eexecute($buffer, $nread)) {\n       $msg = $unpacker-\u003edata();\n\n       var_dump($msg);\n\n       $unpacker-\u003ereset();\n       $buffer = substr($buffer, $nread);\n       $nread = 0;\n       if(!empty($buffer)) {\n            continue;\n       }\n   }\n   break;\n}\n\n```\n\n## Resources\n * [msgpack](http://msgpack.org/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgpack%2Fmsgpack-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsgpack%2Fmsgpack-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgpack%2Fmsgpack-php/lists"}