2017 © Pedro Peláez
 

library phupnp

PHP based UPnP device discovery

image

cyberline/phupnp

PHP based UPnP device discovery

  • Tuesday, May 24, 2016
  • by CyberLine
  • Repository
  • 1 Watchers
  • 2 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

phUPnP

PHP based UPnP device discovery, (*1)

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Example

Install using composer

composer require cyberline/phupnp

Discover all devices with timeout of 1 second

namespace CyberLine\phUPnP
{
    require 'src/Scanner.php';

    try {
        $scanner = new Scanner;
        $scanner
            ->setTimeout(1);

        print_r($scanner->discover());
    } catch (\Exception $e) {
        print 'Exception: ' . $e->getMessage() . PHP_EOL;
    }
}

Discover only root devices

namespace CyberLine\phUPnP
{
    require 'src/Scanner.php';

    try {
        $scanner = new Scanner;
        $scanner
            ->setTimeout(1)
            ->setSearchType('upnp:rootdevice');

        print_r($scanner->discover());
    } catch (\Exception $e) {
        print 'Exception: ' . $e->getMessage() . PHP_EOL;
    }
}

Return json string from scanner

namespace CyberLine\phUPnP
{
    require 'src/Scanner.php';

    try {
        print json_encode(new Scanner);
    } catch (\Exception $e) {
        print 'Exception: ' . $e->getMessage() . PHP_EOL;
    }
}

The Versions

24/05 2016

dev-master

9999999-dev https://github.com/CyberLine/phUPnP

PHP based UPnP device discovery

  Sources   Download

proprietary

The Requires

  • php >=5.3.0

 

by Alexander Over