PHP code example of junker / google-api-service-provider
1. Go to this page and download the library: Download junker/google-api-service-provider library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
junker / google-api-service-provider example snippets
$app->register(new Junker\Silex\Provider\GoogleApiServiceProvider(), [
'google.api.client.id' => '22166332432432113784.apps.googleusercontent.com', #optional
'google.api.client.secret' => 'qa4R-T3-K7p4hWGtZ1SVpMlr.apps.googleusercontent.com', #optional
'google.api.client.scopes' => ['https://www.googleapis.com/auth/userinfo.profile'], #optional
'google.api.service.key_file' => __DIR__.'/../google.json', #optional
'google.api.service.scopes' => __DIR__.'/../google.json', #optional
'google.api.developer.key' => 'AIzgSyrQTNQ-kNhhwVYjTLakWEW_T89zbCvzYS8', #optional
]);
$oauth_client = $app['google.api.client'];
$service_client = $app['google.api.service'];
$developer_client = $app['google.api.developer'];