1
1
# PHP MQTT Client
2
2
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.
6
5
7
6
[ ![ Build Status] ( https://travis-ci.org/oliverlorenz/phpMqttClient.svg?branch=master )] ( https://travis-ci.org/oliverlorenz/phpMqttClient )
8
7
[ ![ Code Climate] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient/badges/gpa.svg )] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient )
9
8
[ ![ Test Coverage] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient/badges/coverage.svg )] ( https://codeclimate.com/github/oliverlorenz/phpMqttClient/coverage )
10
9
11
10
## Goal
12
11
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.
15
14
* Protocol specifications: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd02/mqtt-v3.1.1-csprd02.html
16
15
17
16
## Example publish
18
17
19
18
``` php
20
19
$config = require 'config.php';
21
20
22
- $connector = ClientFactory::createClient(new Version4(), '8.8.8.8' );
21
+ $connector = ClientFactory::createClient(new Version4());
23
22
24
23
$p = $connector->create($config['server'], $config['port'], $config['options']);
25
24
$p->then(function(Stream $stream) use ($connector) {
@@ -33,7 +32,7 @@ $connector->getLoop()->run();
33
32
``` php
34
33
$config = require 'config.php';
35
34
36
- $connector = ClientFactory::createClient(new Version4(), '8.8.8.8' );
35
+ $connector = ClientFactory::createClient(new Version4());
37
36
38
37
$p = $connector->create($config['server'], $config['port'], $config['options']);
39
38
$p->then(function(\React\Stream\Stream $stream) use ($connector) {
0 commit comments