gravitymedia / ssdp
Simple Service Discovery Protocol (SSDP) library for PHP
Installs: 79
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/gravitymedia/ssdp
Requires
- php: >=5.4
- gravitymedia/urn: ~0.1
- guzzle/http: ~3.9
- rhumsaa/uuid: ~2.8
- symfony/event-dispatcher: ~2.6
Requires (Dev)
- phpunit/phpunit: ~4.5
- sami/sami: ~3.0
This package is auto-updated.
Last update: 2023-02-27 01:05:35 UTC
README
Simple Service Discovery Protocol (SSDP) library for PHP.
Requirements
This library has the following requirements:
- PHP 5.6+
Installation
Install Composer in your project:
$ curl -s https://getcomposer.org/installer | php
Add the package to your composer.json
and install it via Composer:
$ php composer.phar require gravitymedia/ssdp
Usage
// Initialize autoloader require 'vendor/autoload.php'; // Import classes use GravityMedia\Ssdp\Client; use GravityMedia\Ssdp\Event\DiscoverEvent; use GravityMedia\Ssdp\Options\AliveOptions; use GravityMedia\Ssdp\Options\DiscoverOptions; use GravityMedia\Ssdp\UniqueServiceName; // Create client $client = new Client(); // Add listeners $client->getEventDispatcher() ->addListener(DiscoverEvent::EVENT_DISCOVER, function (DiscoverEvent $event) { var_dump($event); }); $client->getEventDispatcher() ->addListener(DiscoverEvent::EVENT_DISCOVER_ERROR, function (DiscoverEvent $event) { var_dump($event->getException()); }); // Create options $options = new DiscoverOptions(); // Discover devices and services $client->discover($options);
Testing
Clone this repository, install Composer and all dependencies:
$ php composer.phar install
Run the test suite:
$ php composer.phar test
Generating documentation
Clone this repository, install Composer and all dependencies:
$ php composer.phar install
Generate the documentation to the build/docs
directory:
$ php composer.phar doc
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.