Skip to content

v1.5.0

Compare
Choose a tag to compare
@Namoshek Namoshek released this 30 Oct 20:59
· 29 commits to master since this release
10750d8

What's Changed

Fixed

  • Fix: Local test setup uses port 1884 for MQTT with authentication by @Namoshek in #127

Changed

  • Pass matched topic wildcards to subscription callback by @Namoshek in #128
  • Bump sonarsource/sonarcloud-github-action from 1.6 to 1.7 by @dependabot in #125

Full Changelog: v1.4.0...v1.5.0


Explanation for #128:
The matched wildcards are now passed as fourth parameter to the subscription callback:

$mqtt->subscribe('foo/+/bar/#', function ($topic, $message, $retained, $matchedWildcards) {
    echo sprintf("Received message on topic [%s]: %s\n", $topic, $message);
    echo sprintf("Matched wildcards: %s\n", json_encode($matchedWildcards));
}, 0);

// Received message on topic [foo/baz/bar/hello/world/42]: hello world!
// Matched wildcards: ["baz", "hello/world/42"]