svilborg/php-roku
Composer 安装命令:
composer require svilborg/php-roku
包简介
PHP Library for communication with Roku External Control Protocol
README 文档
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.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2014-08-02