svilborg / guzzle-encoding-com
Encoding.com XML API 的 PHP 库
v0.3.0
2013-08-21 09:03 UTC
Requires
- php: >=5.3.2
- guzzle/guzzle: *
Requires (Dev)
- phing/phing: dev-master
- phpunit/phpunit: 3.7.*@dev
This package is auto-updated.
Last update: 2024-08-29 04:25:22 UTC
README
A Guzzle 客户端用于 Encoding.com 的 XML API . (注意:非官方)
安装
使用 composer 安装
{
"require" : "svilborg/guzzle-encoding-com"
}
要求
- PHP 版本 >=5.3.2.
- PHP Guzzle 库
- 需要从 Encoding.com 获取 API 密钥和用户 ID
- 请参阅 API 文档
用法
use Gencoding\Guzzle\Encoding\EncodingClient; $client = EncodingClient::factory(array( 'userid' => '12345', 'userkey' => 'X1Y2Z3A4B5C6')); $command = $client->getCommand('GetMediaInfo', array( "mediaid" => 8888888888 )); try { $result = $command->getResult(); $resultObject = $result->getXmlElement(); } catch (\Exception $e) { // Catch Errors }
运行测试
首先,使用 composer.phar install --dev
安装 PHPUnit,然后运行 ./vendor/bin/phpunit
.