Download the PHP package idk/yii2-google-apiclient without Composer
On this page you can find all versions of the php package idk/yii2-google-apiclient. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download idk/yii2-google-apiclient
More information about idk/yii2-google-apiclient
Files in idk/yii2-google-apiclient
Package yii2-google-apiclient
Short Description A Yii2 wrapper for the official Google API PHP Client
License MIT
Homepage https://github.com/idk-tn/yii2-google-apiclient
Informations about the package yii2-google-apiclient
yii2-google-apiclient
A Yii2 wrapper for the official Google API PHP Client.
This extension comes with:
- A console utility to generate your credentials files
- A component that will take care of the authentication, and give you access to the service
Installation
The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json
:
Configuration
Credentials file
In order to use this extension, you will be needing a credentials file for your Google Application.
You can generate this file using the provided console utility:
-
Configure the module in
config/console.php
: - Use the /configure sub command:
where clientSecretPath
is the path to your secret JSON file obtained from the Google Console and api
the api identifier (it will be prompted for if not provided).
Components
You application may use as much Google_Service instances as you need, by adding an entry into the components
index of the Yii configuration array.
Here's how to setup GMail for example, a usage sample is provided below.
This will enable you to access the GMail authenticated service Yii::$app->google->getService()
in your application.
Sample usage
Displaying your newest message subject on GMail