**SOLVED **
How can I get the Google+ PHP API to work with code igniter, just called the autoload.php or client does not work. I think there is a conflict somewhere when the google api uses '$this' to refer to its class but it ends calling a code igniter class that does not exist.
I tried integrating using libraries but could only get client to work, I need Google_HttpRequest to work as well.
here is what I have tried normally and it doesn't even work
require_once getcwd().'/google-api-php-client-master/autoload.php';
$client = new Google_Client();
$client->setApplicationName('app_name');
$client->setClientId('my_client_id');
$client->setClientSecret('my_client_secret');
$client->setDeveloperKey('my_developer_key');
$client->authenticate($auth_code);
$access_token = $client->getAccessToken();
echo $access_token;
and this is the error I get:
Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error fetching OAuth2 access token, message: 'invalid_request'' in /home/my_name/public_html/google-api-php-client-master/src/Google/Auth/OAuth2.php:120
Stack trace:
0 /home/my_name/public_html/google-api-php-client-master/src/Google/Client.php(120): Google_Auth_OAuth2->authenticate('4/zfxGdy7q1VhTj...') 1 /home/my_name/public_html/application/models/login_model.php(37): Google_Client->authenticate('4/zfxGdy7q1VhTj...') 2 /home/my_name/public_html/application/controllers/Store.php(3916): Login_model->google_validate() 3 [internal function]: Store->google_login() 4 /home/my_name/public_html/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array) 5 /home/my_name/public_html/index.php(223): require_once('/home/nemesisfo...') 6 {main} thrown in /home/my_name/public_html/google-api-php-client-master/src/Google/Auth/OAuth2.phpon line 120
So any ideas?