11# PHP MQTT Client
22
3- phpMqttClient is an MQTT client library for PHP. Its based on the reactPHP
4- socket-client and added the mqtt protocol specific functions. I hope its a
5- better starting point that the existing php mqtt libraries.
3+ phpMqttClient is an MQTT client library for PHP. Its based on the reactPHP socket-client and added the MQTT protocol
4+ specific functions. I hope its a better starting point that the existing PHP MQTT libraries.
65
76[ ![ Build Status] ( https://travis-ci.org/oliverlorenz/phpMqttClient.svg?branch=master )] ( https://travis-ci.org/oliverlorenz/phpMqttClient )
87[ ![ Code Climate] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient/badges/gpa.svg )] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient )
98[ ![ Test Coverage] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient/badges/coverage.svg )] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient/coverage )
109
1110## Goal
1211
13- Goal of this project is easy to use MQTT client for PHP in a modern architecture
14- without using any php modules. Currently, only protocol version 4 (mqtt 3.1.1) is implemented.
12+ Goal of this project is easy to use MQTT client for PHP in a modern architecture without using any php modules.
13+ Currently, only protocol version 4 (mqtt 3.1.1) is implemented.
1514* Protocol specifications: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd02/mqtt-v3.1.1-csprd02.html
1615
1716## Example publish
1817
1918``` php
2019$config = require 'config.php';
2120
22- $connector = ClientFactory::createClient(new Version4(), '8.8.8.8' );
21+ $connector = ClientFactory::createClient(new Version4());
2322
2423$p = $connector->create($config['server'], $config['port'], $config['options']);
2524$p->then(function(Stream $stream) use ($connector) {
@@ -33,7 +32,7 @@ $connector->getLoop()->run();
3332``` php
3433$config = require 'config.php';
3534
36- $connector = ClientFactory::createClient(new Version4(), '8.8.8.8' );
35+ $connector = ClientFactory::createClient(new Version4());
3736
3837$p = $connector->create($config['server'], $config['port'], $config['options']);
3938$p->then(function(\React\Stream\Stream $stream) use ($connector) {
0 commit comments