{"id":21013854,"url":"https://github.com/jdecool/php-mercure","last_synced_at":"2025-03-13T16:21:49.842Z","repository":{"id":56997556,"uuid":"268909712","full_name":"jdecool/php-mercure","owner":"jdecool","description":"Fork of the official symfony/mercure component using `HTTPlug` client.","archived":false,"fork":false,"pushed_at":"2020-12-15T20:53:25.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T22:30:42.578Z","etag":null,"topics":[],"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/jdecool.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}},"created_at":"2020-06-02T21:12:35.000Z","updated_at":"2020-12-15T20:53:28.000Z","dependencies_parsed_at":"2022-08-21T14:50:14.015Z","dependency_job_id":null,"html_url":"https://github.com/jdecool/php-mercure","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdecool%2Fphp-mercure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdecool%2Fphp-mercure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdecool%2Fphp-mercure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdecool%2Fphp-mercure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdecool","download_url":"https://codeload.github.com/jdecool/php-mercure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243438122,"owners_count":20290902,"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-19T09:44:20.218Z","updated_at":"2025-03-13T16:21:49.820Z","avatar_url":"https://github.com/jdecool.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Mercure PHP component for HTTPlug\n=================================\n\n[![Build Status](https://github.com/jdecool/php-mercure/workflows/Continuous%20Integration/badge.svg)](https://github.com/jdecool/php-mercure/actions?query=workflow%3A%22Continuous+Integration%22)\n[![Latest Stable Version](https://poser.pugx.org/jdecool/mercure/v/stable.png)](https://packagist.org/packages/jdecool/mercure)\n\nThis is a fork of the official [`symfony/mercure`](https://github.com/symfony/mercure) component using `HTTPlug` client.\n\nThanks to [Kévin Dunglas](https://github.com/dunglas/) for his incredible work on [Mercure.rocks](Mercure.rocks).\nThanks to all Symfony \u0026 Mercure contributors.\n\n\u003e Mercure is a protocol allowing to push data updates to web browsers and other\n  HTTP clients in a convenient, fast, reliable and battery-efficient way.\n  It is especially useful to publish real-time updates of resources served through\n  web APIs, to reactive web and mobile apps.\n\nThis component implements the \"publisher\" part of [the Mercure Protocol](https://mercure.rocks).\n\n## Install it\n\nInstall using [composer](https://getcomposer.org), you need to install a [PSR-18](https://www.php-fig.org/psr/psr-18/) compliant HTTP client.\n\nExample using Guzzle:\n\n```bash\ncomposer require jdecool/mercure guzzlehttp/guzzle http-interop/http-factory-guzzle\n```\n\n## Getting started\n\n```php\n// change these values accordingly to your hub installation\ndefine('HUB_URL', 'https://demo.mercure.rocks/.well-known/mercure');\ndefine('JWT', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyJmb28iLCJiYXIiXSwicHVibGlzaCI6WyJmb28iXX19.LRLvirgONK13JgacQ_VbcjySbVhkSmHy3IznH3tA9PM');\n\nuse JDecool\\Mercure\\Jwt\\StaticJwtProvider;\nuse JDecool\\Mercure\\PublisherFactory;\nuse JDecool\\Mercure\\Update;\n\n$factory = new PublisherFactory();\n$publisher = $factory-\u003ecreate(HUB_URL, new StaticJwtProvider(JWT));\n$response = $publisher(new Update('https://example.com/books/1.jsonld', 'Hi from Symfony!'));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdecool%2Fphp-mercure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdecool%2Fphp-mercure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdecool%2Fphp-mercure/lists"}