1. Go to this page and download the library: Download simplon/gplus 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/ */
simplon / gplus example snippets
$authVo = (new \Simplon\Gplus\Vo\GplusAuthVo())
->setClientId(CLIENT_ID)
->setClientSecret(CLIENT_SECRET)
->setUrlRedirect(AUTH_URL_REDIRECT); // URL to which google redirects after authentication
$authVo = (new \Simplon\Gplus\Vo\GplusAuthVo())
->setClientId(CLIENT_ID)
->setClientSecret(CLIENT_SECRET)
->setUrlRedirect(AUTH_URL_REDIRECT);
->forceApprovalPrompt();
// pass our prior created authVo
$gplus = new \Simplon\Gplus\Gplus($authVo);
// with class constants (highly recommended)
$scopes = [
\Simplon\Gplus\GplusConstants::AUTH_SCOPE_EMAIL,
\Simplon\Gplus\GplusConstants::AUTH_SCOPE_PROFILE,
];
// without class constants
$scopes = ['email', 'profile',];
// pass prior defined $scopes
$urlAuth = $gplus->getAuthUrl($scopes);