Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
use Gaufrette\Adapter\GoogleCloudStorage;
$keyFileLocation = '/home/me/path/to/service-auth-key.json';
$bucketName = 'gaufrette-bucket-test-' . uniqid();
$projectId = 'your-project-id-000';
$bucketLocation = 'EUROPE-WEST9';
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $keyFileLocation);
$client = new \Google\Client();
$client->setApplicationName('Gaufrette');
$client->addScope(Google\Service\Storage::DEVSTORAGE_FULL_CONTROL);
$client->useApplicationDefaultCredentials();
$service = new \Google\Service\Storage($client);
return new GoogleCloudStorage(
$service,
$bucketName,
[
GoogleCloudStorage::OPTION_CREATE_BUCKET_IF_NOT_EXISTS => true,
GoogleCloudStorage::OPTION_PROJECT_ID => $projectId,
GoogleCloudStorage::OPTION_LOCATION => $bucketLocation,
],
true
);