The document provides instructions for authenticating with Google APIs and accessing Google Drive files using the Eden PHP library. It describes getting an API access token by redirecting the user to Google for authentication. It then shows how to instantiate a Google Drive class using the access token to get a list of user files, get specific files, move files to the trash, and delete files.
9. //start session
session_start();
//get auth
$auth = eden(‘google’)->auth($clientId, $clientSecret, $redirect);
//if no code and no session
if(!isset($_GET['code']) && !isset($_SESSION*‘google_token'])) {
//redirect to login
$login = $auth- >getLoginUrl();
header('Location: '.$login);
exit;
}
//Code is returned back from google
if(isset($_GET['code'])) {
//save it to session
$access = $auth->getAccess($_GET['code']);
$_SESSION*‘google_token'] = $access['access_token'];
}