- Docker 개발 환경 구성 (nginx, php, mariadb) - 그누보드 기본 extend 파일들 추가 - R2 파일 목록 확인 스크립트 추가 - .gitignore 설정 (gnuboard 코어, 테스트 파일 제외) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
893 B
PHP
31 lines
893 B
PHP
<?php
|
|
require_once __DIR__ . "/extend/r2-storage/vendor/autoload.php";
|
|
require_once __DIR__ . "/extend/r2-storage/r2_config.php";
|
|
|
|
try {
|
|
$client = new Aws\S3\S3Client([
|
|
"region" => "auto",
|
|
"version" => "latest",
|
|
"endpoint" => R2_ENDPOINT,
|
|
"credentials" => [
|
|
"key" => R2_ACCESS_KEY_ID,
|
|
"secret" => R2_SECRET_ACCESS_KEY,
|
|
],
|
|
"use_path_style_endpoint" => true,
|
|
]);
|
|
|
|
$result = $client->listObjectsV2([
|
|
"Bucket" => R2_BUCKET_NAME,
|
|
"MaxKeys" => 100,
|
|
]);
|
|
|
|
$contents = $result->get("Contents") ?? [];
|
|
echo "=== R2 버킷 파일 목록 ===\n\n";
|
|
foreach ($contents as $obj) {
|
|
echo $obj["Key"] . " (" . number_format($obj["Size"]) . " bytes)\n";
|
|
}
|
|
echo "\n총 " . count($contents) . "개 파일\n";
|
|
} catch (Exception $e) {
|
|
echo "Error: " . $e->getMessage() . "\n";
|
|
}
|