bezyr / google-api-bundle
Symfony 扩展,用于封装 Google API
1.0.7
2017-07-23 13:22 UTC
Requires
- php: >=5.5
- google/apiclient: 2.1.3
- symfony/symfony: 2.8.*
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-18 20:40:04 UTC
README
GoogleApiBundle
为需要 Google PHP SDK 的 Symfony2 项目提供简单集成
安装
Composer
composer require beyerz/google-api-bundle
应用内核
将 BeyerzGoogleApiBundle 添加到应用内核的 registerBundles()
方法中
public function registerBundles() { return array( new Beyerz\GoogleApiBundle\BeyerzGoogleApiBundle(), ); }
配置
通过在应用的 config.yml
文件中添加以下内容,启用加载 OGP 服务并设置默认值
目前支持基础和 Facebook 库,但你可以添加任意数量的库和默认值
#BeyerzGoogleApiBundle beyerz_google_api: application_name: 'Sample Application Name' credentials_manager: 'Beyerz\GoogleApiBundle\Manager\CredentialsManager' client_secret_path: '/Resources/client_secret.json' scopes: - 'https://www.googleapis.com/auth/gmail.readonly' - 'https://www.googleapis.com/auth/gmail.send' - 'https://www.googleapis.com/auth/plus.login' - 'https://www.googleapis.com/auth/contacts' - 'https://www.googleapis.com/auth/contacts.readonly' - 'https://www.googleapis.com/auth/plus.login' - 'https://www.googleapis.com/auth/plus.me' - 'https://www.googleapis.com/auth/userinfo.email' - 'https://www.googleapis.com/auth/userinfo.profile' services: gmail: access_type: "offline" plus: access_type: "offline" people: access_type: "offline" oauth2: access_type: "offline"