{"id":24521798,"url":"https://github.com/oliverlorenz/phpmqttclient","last_synced_at":"2025-04-14T11:50:27.621Z","repository":{"id":57031019,"uuid":"35181065","full_name":"oliverlorenz/phpMqttClient","owner":"oliverlorenz","description":"a mqtt client library for php","archived":false,"fork":false,"pushed_at":"2019-10-01T05:20:21.000Z","size":151,"stargazers_count":37,"open_issues_count":8,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T00:51:17.896Z","etag":null,"topics":["mqtt","mqtt-client","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oliverlorenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-06T20:24:10.000Z","updated_at":"2024-06-30T14:42:01.000Z","dependencies_parsed_at":"2022-08-23T18:50:35.029Z","dependency_job_id":null,"html_url":"https://github.com/oliverlorenz/phpMqttClient","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlorenz%2FphpMqttClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlorenz%2FphpMqttClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlorenz%2FphpMqttClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlorenz%2FphpMqttClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverlorenz","download_url":"https://codeload.github.com/oliverlorenz/phpMqttClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877894,"owners_count":21176237,"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":["mqtt","mqtt-client","php"],"created_at":"2025-01-22T03:16:36.946Z","updated_at":"2025-04-14T11:50:27.576Z","avatar_url":"https://github.com/oliverlorenz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP MQTT Client\n\nphpMqttClient is an MQTT client library for PHP. Its based on the reactPHP socket-client and added the MQTT protocol\nspecific functions. I hope its a better starting point that the existing PHP MQTT libraries. \n\n[![Build Status](https://travis-ci.org/oliverlorenz/phpMqttClient.svg?branch=master)](https://travis-ci.org/oliverlorenz/phpMqttClient) \n[![Code Climate](https://codeclimate.com/github/oliverlorenz/phpMqttClient/badges/gpa.svg)](https://codeclimate.com/github/oliverlorenz/phpMqttClient) \n[![Test Coverage](https://codeclimate.com/github/oliverlorenz/phpMqttClient/badges/coverage.svg)](https://codeclimate.com/github/oliverlorenz/phpMqttClient/coverage)\n\n## Goal\n\nGoal of this project is easy to use MQTT client for PHP in a modern architecture without using any php modules.\nCurrently, only protocol version 4 (mqtt 3.1.1) is implemented.\n* Protocol specifications: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd02/mqtt-v3.1.1-csprd02.html\n\n## Example publish\n\n```php\n$config = require 'config.php';\n\n$connector = ClientFactory::createClient(new Version4());\n\n$p = $connector-\u003ecreate($config['server'], $config['port'], $config['options']);\n$p-\u003ethen(function(Stream $stream) use ($connector) {\n    return $connector-\u003epublish($stream, 'a/b', 'example message');\n});\n$connector-\u003egetLoop()-\u003erun();\n```\n\n## Example subscribe\n\n```php\n$config = require 'config.php';\n\n$connector = ClientFactory::createClient(new Version4());\n\n$p = $connector-\u003ecreate($config['server'], $config['port'], $config['options']);\n$p-\u003ethen(function(\\React\\Stream\\Stream $stream) use ($connector) {\n    $stream-\u003eon(Publish::EVENT, function(Publish $message) {\n        print_r($message);\n    });\n    \n    $connector-\u003esubscribe($stream, 'a/b', 0);\n    $connector-\u003esubscribe($stream, 'a/c', 0);\n});\n\n$connector-\u003egetLoop()-\u003erun();\n```\n\n## Notice - (May 12th, 2015)\nThis is library is not stable currently. Its an early state, but I am working on it. I will add more features if I need them. If you need features: please give feedback or contribute to get this library running.\n\nCurrently works:\n* connect (clean session, no other connect flags)\n* disconnect\n* publish\n* subscribe\n\n## Run tests\n\n    ./vendor/bin/phpunit -c ./tests/phpunit.xml ./tests\n\n\n## Troubleshooting\n\n### Why does the connect to localhost:1883 not work?\n\nThe answer is simple: In the example is the DNS 8.8.8.8 configured. Your local server is not visible for them, so you can't connect.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverlorenz%2Fphpmqttclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverlorenz%2Fphpmqttclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverlorenz%2Fphpmqttclient/lists"}