0

I'm a bit new to cakephp and I'm struggling to find a good tutorial which explains how to import the Google PHP SDK into my cakephp 2 project.

I only want to use the Google+ bit to allow users to authenticate with Google. I've downloaded the SDK from https://github.com/google/google-api-php-client and placed the src folder inside a Google Folder in the Vendor Folder. So like this: app/Vendor/Google/src/...

Then in my controller I try to load the class using:

App::import('Vendor','Google');
$client = new Google_Client();

I have tried a bunch of other variations which I've found online but I believe they are old because the folder structure of the SDK is different.

Can anyone please tell me how I can include it properly.

thanks

1 Answers1

0

You can try require .'path_to_google_sdk/autoload.php';

FoxVSky
  • 124
  • 5
  • I tried: require_once '../Vendor/Google/src/Google/autoload.php'; but now I get the error: This library must be installed via composer or by downloading the full package. I have the full package in the folder. Any ideas what's going on? – David Laird May 16 '18 at 12:53
  • you can see here https://stackoverflow.com/questions/33570979/installing-google-client-library-for-google-analtics-php – FoxVSky May 17 '18 at 02:52