pixelfederation/google-api-php-client
最新稳定版本:1.1.1
Composer 安装命令:
composer require pixelfederation/google-api-php-client
包简介
A wrapper for the official Google api PHP client.
README 文档
README
A wrapper for the official Google api PHP client.
Usage
To install the composer package, run the following command:
composer require pixelfederation/google-api-php-client
After the installation of the dependencies, the Client should be instantiated this way:
$googleServiceFactory = new \PixelFederation\GoogleApi\Factory\GoogleServiceFactory('Server API key'); $resultFactory = new \PixelFederation\GoogleApi\Factory\ResultFactory(); $client = new \PixelFederation\GoogleApi\Client($googleServiceFactory, $resultFactory);
- $googleServiceFactory: "Server Api key" documentation - https://developers.google.com/api-client-library/php/auth/api-keys
Now you are able to call methods from ClientInterface. For example, if you can read something from https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
// $client->getSheetById($spreadsheetId, $name, array $keys, $range = 'A1:XXX'); /** * @param string $spreadsheetId The ID of the spreadsheet to retrieve data from. * @param string $name Name of Sheet * @param array $keys Names of column what you can retrieve * @param string $range The A1 notation of the values to retrieve. * * @return Result */ $result = $client->getSheetById("1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms", "Class Data", [ "Student Name", "Gender", "Home State", ]); $response = $result->findBy([ 'Gender' => "Female", "Home State" => "MD" ]); /* Array ( [8] => Array ( [Student Name] => Dorothy [Gender] => Female [Home State] => MD ) ) */
统计信息
- 总下载量: 424
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-06-28