PHP code example of yidas / google-apiclient-helper
1. Go to this page and download the library: Download yidas/google-apiclient-helper 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/ */
yidas / google-apiclient-helper example snippets
$client = \yidas\google\apiHelper\Client::setClient()
->setApplicationName('Google API')
->setAuthConfig('/path/google_api_secret.json')
->setRedirectUri("http://{$_SERVER['HTTP_HOST']}" . dirname($_SERVER['PHP_SELF'])
->setAccessToken($accessToken)
->getClient();
if ($accessToken = ClientHelper::refreshAccessToken()) {
// saveAccessToken($accessToken)
}
// People Service uses Google_Client from Client helper above
$contacts = \yidas\google\apiHelper\services\People::getSimpleContacts();
use \yidas\google\apiHelper\services\People as PeopleHelper;
\yidas\google\apiHelper\Client::setClient([...])
$contacts = PeopleHelper::getSimpleContacts();
use \yidas\google\apiHelper\services\People as PeopleHelper;
PeopleHelper::setClient($googleClient);
// PeopleHelper::method()...