Skip to content

Commit 3fb3eaa

Browse files
committed
Improve documentation and examples
1 parent 4e6ca49 commit 3fb3eaa

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# clue/reactphp-ssdp
22

3-
[![CI status](https://github.com/clue/reactphp-ssdp/workflows/CI/badge.svg)](https://github.com/clue/reactphp-ssdp/actions)
3+
[![CI status](https://github.com/clue/reactphp-ssdp/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-ssdp/actions)
44
[![installs on Packagist](https://img.shields.io/packagist/dt/clue/ssdp-react?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/ssdp-react)
55

6-
Async [Simple Service Discovery Protocol (SSDP)](http://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol), built on top of [ReactPHP](https://reactphp.org/).
6+
Async [Simple Service Discovery Protocol (SSDP)](https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol), built on top of [ReactPHP](https://reactphp.org/).
77

8-
SSDP is part of [Universal Plug and Play (UPnP)](http://de.wikipedia.org/wiki/Universal_Plug_and_Play)
8+
SSDP is part of [Universal Plug and Play (UPnP)](https://de.wikipedia.org/wiki/Universal_Plug_and_Play)
99
and is commonly used to discover network services on home networks without
1010
requiring any manual configuration, such as automatically discovering printers,
1111
multimedia devices and network routers.
1212

1313
This library implements SSDP as defined in the
1414
[UPnP device architecture definition](http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf) (PDF)
1515
and uses HTTP over Multicast UDP (HTTPMU) as defined in the
16-
[IETF draft](https://tools.ietf.org/html/draft-goland-http-udp-01).
16+
[IETF draft](https://datatracker.ietf.org/doc/html/draft-goland-http-udp-01).
1717
As an alternative, some devices use DNS-Based Service Discovery (DNS-SD) instead
18-
as defined in [RFC 6763](http://tools.ietf.org/html/rfc6763).
18+
as defined in [RFC 6763](https://tools.ietf.org/html/rfc6763).
1919

2020
**Table of Contents**
2121

@@ -31,13 +31,17 @@ as defined in [RFC 6763](http://tools.ietf.org/html/rfc6763).
3131
Once [installed](#install), you can use the following code to search all available UPnP devices in your network:
3232

3333
```php
34+
<?php
35+
36+
require __DIR__ . '/vendor/autoload.php';
37+
3438
$client = new Clue\React\Ssdp\Client();
3539

3640
$client->search()->then(
3741
function () {
3842
echo 'Search completed' . PHP_EOL;
3943
},
40-
function($e) {
44+
function(Exception $e) {
4145
echo 'There was an error searching for devices: ' . $e . PHP_EOL;
4246
},
4347
function ($progress) {
@@ -48,11 +52,11 @@ $client->search()->then(
4852
);
4953
```
5054

51-
See also the [examples](examples).
55+
See also the [examples](examples/).
5256

5357
## Install
5458

55-
The recommended way to install this library is [through composer](http://getcomposer.org). [New to composer?](http://getcomposer.org/doc/00-intro.md)
59+
The recommended way to install this library is [through composer](https://getcomposer.org/). [New to composer?](https://getcomposer.org/doc/00-intro.md)
5660

5761
```JSON
5862
{
@@ -65,21 +69,21 @@ The recommended way to install this library is [through composer](http://getcomp
6569
This project aims to run on any platform and thus does not require any PHP
6670
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
6771
HHVM.
68-
It's *highly recommended to use PHP 7+* for this project.
72+
It's *highly recommended to use the latest supported PHP version* for this project.
6973

7074
## Tests
7175

7276
To run the test suite, you first need to clone this repo and then install all
73-
dependencies [through Composer](https://getcomposer.org):
77+
dependencies [through Composer](https://getcomposer.org/):
7478

7579
```bash
76-
$ composer install
80+
composer install
7781
```
7882

7983
To run the test suite, go to the project root and run:
8084

8185
```bash
82-
$ php vendor/bin/phpunit
86+
vendor/bin/phpunit
8387
```
8488

8589
## License

examples/demo.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<?php
22

3-
use Clue\React\Ssdp\Client;
4-
53
require __DIR__ . '/../vendor/autoload.php';
64

7-
$client = new Client();
5+
$client = new Clue\React\Ssdp\Client();
86

97
$client->search()->then(
108
function () {
119
echo 'Search completed' . PHP_EOL;
1210
},
13-
function($e) {
11+
function(Exception $e) {
1412
echo 'There was an error searching for devices: ' . $e . PHP_EOL;
1513
},
1614
function ($progress) {

0 commit comments

Comments
 (0)