google/apiclient
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
firebase/php-jwt | v6.10.0 | 23.55 kB | BSD-3-Clause | prod | |
google/auth | v1.39.0 | - | Apache-2.0 | prod | |
guzzlehttp/guzzle | 7.8.1 | 112.34 kB | MIT | prod dev | |
guzzlehttp/psr7 | 2.6.2 | 76.41 kB | MIT | prod dev | |
monolog/monolog | 3.6.0 | - | MIT | prod | |
phpseclib/phpseclib | 3.0.37 | - | MIT | prod dev |
The "google/apiclient" is a composer package that serves as a client library for Google APIs, which enables your server to interact with Google APIs such as Gmail, Drive, or YouTube. It's officially supported by Google and is currently in maintenance mode. This implies that no new features will be added, but critical bugs and security issues will be addressed.
The "google/apiclient" is beneficial when you want to use various Google services in your PHP application. To utilize this client library, you first need to install it via Composer by executing the following command in your project root:
composer require google/apiclient:^2.15.0
After installation, include the autoloader in your PHP script:
require_once '/path/to/your-project/vendor/autoload.php';
Here is a basic example of how to use this library:
require_once 'vendor/autoload.php';
$client = new Google\Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("YOUR_APP_KEY");
$service = new Google\Service\Books($client);
$query = 'Henry David Thoreau';
$optParams = [
'filter' => 'free-ebooks',
];
$results = $service->volumes->listVolumes($query, $optParams);
foreach ($results->getItems() as $item) {
echo $item['volumeInfo']['title'], "<br /> \n";
}
In this example, a new Google client instance is created, the application name and developer key are set, and the Google Books service is called. A query is performed to list free e-books related to 'Henry David Thoreau' and the titles of those e-books are output.
The documentation for the "google/apiclient" package can be found at this URL: https://googleapis.github.io/google-api-php-client/main/. The documentation includes detailed guides on how to use this library, which can be found in the docs directory of the repo.