} // var_dump($returnData);die; return [ 'data' => $returnData, 'tasksCounter' => $tasksCounter, 'projectsCounter' => $projectsCounter, ]; } // Get the API client and construct the service object. $client = getClient(); $service = new Google_Service_Drive($client); logMessage('Current account: ' . getConnectedEmail($client)); $user = $service->about->get()->getUser(); logMessage('Drive owner:' . $user->displayName . ' <' . $user->emailAddress . '>'); // Print the names and IDs for up to 10 files. logMessage("Getting templates..."); $gFiles = retrieveFiles($service); if (count($gFiles) == 0) { logMessage("No templates found", LOG_WARNING); closeSession(); } else { foreach ($gFiles as $file) { /*printf("%s (%s) %s (%s)\n",
return $client; } echo "Commands:<br>"; echo "php cli.php -d to delete token<br>"; echo "php cli.php -r to refresh token<br>"; echo "php cli.php -v get version<br>"; echo "<hr>"; if (!is_writable(dirname($credentialsPath))) { die("<strong>" . dirname($credentialsPath) . "</strong> is not <u>writable</u>"); } if (!is_writable(TMP_PATH)) { die("<strong>" . TMP_PATH . "</strong> is not <u>writable</u>"); } if (!ASANA_API_KEY) { die("<strong>ASANA_API_KEY</strong> is empty"); } if (!BASE_SERVER) { die("<strong>BASE_SERVER</strong> is empty"); } $client = getClient(); echo 'Current account: ' . getConnectedEmail($client);