marvelley/google-books-api-client
Composer 安装命令:
composer require marvelley/google-books-api-client
包简介
A Google Books API Client
关键字:
README 文档
README
About
A PHP client for the Google Books API. Based on the Guzzle library
Installation
Installing via Composer
The recommended way to install the library is via Composer.
-
Add
marvelley/google-books-api-clientas a dependency in your project'scomposer.jsonfile:{ "require": { "marvelley/google-books-api-client": "*" } }Consider tightening your dependencies to a known version when deploying mission critical applications (e.g.
2.8.*). -
Download and install Composer:
curl -s http://getcomposer.org/installer | php -
Install your dependencies:
php composer.phar install -
Require Composer's autoloader
Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:
require 'vendor/autoload.php';
You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.
Using the client
<?php $client = GoogleBooksApiClient::factory(array('base_url' => 'https://www.googleapis.com')); $command = $client->getCommand('GetVolume', array('id' => 'zyTCAlFPjgYC')); $responseModel = $client->execute($command); $data = $responseModel->toArray(); echo $data['id']; // prints 'zyTCAlFPjgYC'
Running the unit tests
vendor/bin/phpunit
统计信息
- 总下载量: 241
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2012-10-25