This commit is contained in:
2026-04-15 19:34:56 +05:00
parent 34ffed1e4a
commit e243821f50
26 changed files with 2072 additions and 1258 deletions

30
scratch/create_bucket.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\Exception\AwsException;
$s3Client = new S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'endpoint' => 'http://minio:9000',
'use_path_style_endpoint' => true,
'credentials' => [
'key' => 'admin',
'secret' => 'password',
],
]);
try {
$result = $s3Client->createBucket([
'Bucket' => 'quyoshli',
]);
echo "Bucket 'quyoshli' created successfully.\n";
} catch (AwsException $e) {
if ($e->getAwsErrorCode() == 'BucketAlreadyOwnedByYou' || $e->getAwsErrorCode() == 'BucketAlreadyExists') {
echo "Bucket 'quyoshli' already exists.\n";
} else {
echo $e->getMessage() . "\n";
}
}