2017 © Pedro PelĂĄez
 

library ssdp

Simple Service Discovery Protocol (SSDP) library for PHP

image

gravitymedia/ssdp

Simple Service Discovery Protocol (SSDP) library for PHP

  • Thursday, April 21, 2016
  • by pCoLaSD
  • Repository
  • 1 Watchers
  • 2 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

Ssdp

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads Dependency Status, (*1)

Simple Service Discovery Protocol (SSDP) library for PHP., (*2)

Requirements

This library has the following requirements:, (*3)

  • PHP 5.6+

Installation

Install Composer in your project:, (*4)

$ curl -s https://getcomposer.org/installer | php

Add the package to your composer.json and install it via Composer:, (*5)

$ 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:, (*6)

``` bash $ php composer.phar install, (*7)


Run the test suite: ``` bash $ php composer.phar test

Generating documentation

Clone this repository, install Composer and all dependencies:, (*8)

``` bash $ php composer.phar install, (*9)


Generate the documentation to the `build/docs` directory: ``` bash $ php composer.phar doc

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions