svilborg / php-roku
PHP Library for communication with Roku External Control Protocol
v1.0.0
2019-01-05 22:54 UTC
Requires
- php: >=7.0.0
- nategood/httpful: *
Requires (Dev)
- phpunit/phpunit: ^4.8.35 || ^5.4.3 || ^6.0
- satooshi/php-coveralls: 2.*
This package is auto-updated.
Last update: 2024-11-06 12:17:35 UTC
README
PHP Library for communication with Roku External Control Protocol
Installation
Installing via Composer
Install composer in a common location or in your project:
curl -s http://getcomposer.org/installer | php
Create the composer.json file as follows:
{ "require": { "svilborg/php-roku": "dev-master" } }
Run the composer installer:
php composer.phar install
Requirements
- PHP Version >=5.3.2.
- PHP Httpful Library
Usage
Execute commands :
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2); $roku->up(); $roku->select(); $roku->literals("test@gmail.com"); $roku->down(); $roku->down(); $roku->select();
List the applicatioin installed on the device :
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2); $applications = $roku->apps(); foreach ($applications as $application) { echo $application->getId(); echo $application->getVersion(); echo $application->getName(); echo "\n"; }
Get device information :
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2); $device = $roku->device(); echo $device->getSerialNumber(); echo $device->getModelName(); echo $device->getModelDescription(); // etc..
Usage Commandline
For the list of commands execute :
$ vendor/bin/roku --help
It displays :
PHP Roku Console Usage: roku [OPTION] .. -h <host> Host -p <port> Port -d <delay> Delay between each command -i Interactive mode (Listens for keyboard keystrokes) -c <commands> Command mode (Specify commands to be executed, Example -c "up down test@gmail.com down select home") -t Test Mode (Does not send commands.Just simulates them.) --help Shows this help
Example usage of command and interactive modes :
$ vendor/bin/roku -h 192.168.72.10 -p 8060 -d 1 -c "up test@gmailc.om down down select home"
$ vendor/bin/roku -h 192.168.72.10 -d 1 -i
Running the tests
First, install PHPUnit with composer.phar install --dev
, then run
./vendor/bin/phpunit
.