1. Go to this page and download the library: Download rivervanrain/google_api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Get the API client and construct the service object.
$api_key = elgg_get_plugin_setting('api_key','google_api');
// Initialize Google Client
$client = new \Google_Client();
$client->setDeveloperKey($api_key);
$client->setApplicationName('my_app');
$client->setScopes(\Google_Service_Sheets::SPREADSHEETS);
$client->setAccessType('offline');
// Authorize Google Client
$data = elgg_get_data_path() . 'google/google_key.json';
$client->setAuthConfig(json_decode($data, true));
// Initialize Google service
$service = new \Google_Service_Sheets($client);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.