endroid/google-api-bundle

该包已被废弃,不再维护。作者建议使用 google/apiclient 包。

Endroid Google API for Symfony

2.0.1 2018-01-03 21:21 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:46:28 UTC


README

endroid 提供

Latest Stable Version Build Status Total Downloads Monthly Downloads License

此包提供与 google/google-api-php-client 的简单集成,允许您访问不同的Google API。有关更多信息,请访问开发者文档

knpbundles.com

安装

使用 Composer 安装此包。

$ composer require endroid/google-api-bundle

然后通过内核启用此包。

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ...
        new Endroid\GoogleApiBundle\EndroidGoogleApiBundle(),
    ];
}

配置

config.yml

endroid_google_api:
    application_name: <application name>
    api_key: <api key>
        

使用

安装和配置后,可以使用Google API客户端访问所需的API。

$client = $this->get('endroid.google_api_client');
$service = new Google_Service_Translate($client);

$translations = $service->translations->listTranslations('Hello', 'fr');

版本

版本号遵循 MAJOR.MINOR.PATCH 方案。向后兼容性破坏性更改将保持在最低限度,但请注意,这些更改可能会发生。在升级时锁定依赖关系并在生产中进行测试。

许可

此包受MIT许可协议的保护。有关完整的版权和许可信息,请查看与源代码一起分发的LICENSE文件。