PHP code example of google / cloud-storage-control
1. Go to this page and download the library: Download google/cloud-storage-control 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/ */
google / cloud-storage-control example snippets
Google\ApiCore\ApiException;
Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
Google\Cloud\Storage\Control\V2\Folder;
Google\Cloud\Storage\Control\V2\GetFolderRequest;
// Create a client.
$storageControlClient = new StorageControlClient();
// Prepare the request message.
$request = (new GetFolderRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Folder $response */
$response = $storageControlClient->getFolder($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}