php-google-people-api icon indicating copy to clipboard operation
php-google-people-api copied to clipboard

Fatal error: Uncaught Error: Class 'GoogleOAuth2Handler' not found i

Open juniorneo2 opened this issue 6 years ago • 3 comments

Hello I'm having error in load the library GoogleOAuth2Handler, Somebody Help me?

`require DIR . '/vendor/autoload.php';

$clientId = '#; $clientSecret = '#'; $refreshToken = '#'; $scopes = ['https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/contacts', 'https://www.googleapis.com/auth/contacts.readonly'];

$googleOAuth2Handler = new GoogleOAuth2Handler($clientId, $clientSecret, $scopes, $refreshToken);

$people = new GooglePeople($googleOAuth2Handler);

$contacts = $people->all();

print_r($contacts);`

Fatal error: Uncaught Error: Class 'GoogleOAuth2Handler' not found in /Applications/MAMP/htdocs/googlecontact/index.php:11 Stack trace: #0 {main} thrown

SO = IOS PHP = 7.1.2 MAMP


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

juniorneo2 avatar Jul 16 '18 13:07 juniorneo2

I solved it, include these two path and it worked.

use RapidWeb\GoogleOAuth2Handler\GoogleOAuth2Handler; use RapidWeb\GooglePeopleAPI\GooglePeople;

juniorneo2 avatar Jul 20 '18 14:07 juniorneo2

I had the same issue. This solved it. Maybe these lines need to be added to the documentation. Good job juniorneo2.

QuesnelJ avatar May 08 '20 01:05 QuesnelJ

I solved it, include these two path and it worked.

use RapidWeb\GoogleOAuth2Handler\GoogleOAuth2Handler; use RapidWeb\GooglePeopleAPI\GooglePeople;

spend few hour to check why this composer package not define!!! thank a tons!

irvine48 avatar Mar 24 '21 14:03 irvine48