I am implementing Google Analytics API and using 
https://code.google.com/p/google-api-php-client/ as Vendors.

I have built a small app in PHP where i need to do the following to have 
access to the Google accounts


// Include Required Libraries
require_once 'lib/apiClient.php';
require_once 'lib/contrib/apiAnalyticsService.php';
session_start();

// Create a Google Object
$client = new apiClient();
$client->setApplicationName("GitGrow");

$client->setClientId('9211ss4169.apps.googleusercontent.com');
$client->setClientSecret('zVPmKcQLs1587zdwcn');
$client->setRedirectUri('http://gitgrow.com/index.php');
$client->setDeveloperKey('AIzaSyCWesssyMz6e9PNKXi5rYhdyeLYI1iZI');
$client->setScopes('https://www.googleapis.com/auth/analytics.readonly');
$client->setApprovalPrompt('auto');

if (isset($_GET['code'])) {
  $client->authenticate();
  $_SESSION['token'] = $client->getAccessToken();
  $redirect = 'http://gitgrow.com/signup.php';
  header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
}

if (!$client->getAccessToken()) {
    $authUrl = $client->createAuthUrl();
}



Since i will need the Google Account Authorization across the whole site. I 
would like to import the same into CakePHP. not sure how to bring and work 
with vendor files inside CakePHP. Can some one throw some light on how it 
can be done ?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to