glueful/storage-gcs 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

glueful/storage-gcs

最新稳定版本:v1.0.0

Composer 安装命令:

composer require glueful/storage-gcs

包简介

Google Cloud Storage driver for the Glueful framework.

README 文档

README

Google Cloud Storage driver for Glueful.

Install

composer require glueful/storage-gcs
php glueful extensions:enable storage-gcs

The package auto-registers as a Glueful extension through extra.glueful.provider. After install, any disk with driver => gcs is resolved by GcsStorageDriverFactory.

Configuration

Add a disk under config/storage.php:

'gcs' => [
    'driver' => 'gcs',
    'bucket' => env('GCS_BUCKET'),
    'project_id' => env('GCS_PROJECT_ID'),
    'key_file' => env('GCS_KEY_FILE'), // path to service-account JSON
    'prefix' => env('GCS_PREFIX', ''),
    'signed_ttl' => (int) env('GCS_SIGNED_URL_TTL', 3600),
],

Environment variables:

GCS_BUCKET=app-bucket
GCS_PROJECT_ID=my-google-cloud-project
GCS_KEY_FILE=/absolute/path/to/service-account.json
GCS_PREFIX=
GCS_SIGNED_URL_TTL=3600

key_file is optional for filesystem construction when your runtime already has Application Default Credentials. Native V4 signed URLs need credentials capable of local signing, so service-account JSON is the normal production configuration.

Native URLs

The framework always supports app-signed blob URLs through /blobs/{uuid}. Direct provider URLs are opt-in and visibility-scoped:

// config/uploads.php
'native_urls' => [
    'disks' => [
        'gcs' => [
            'enabled' => true,
            'public' => true,
            'private' => false,
            'private_ttl' => 300,
        ],
    ],
    'max_private_ttl' => 900,
],

Private native URLs are bearer tokens from Google Cloud Storage. Keep them short-lived and prefer the app-signed URL when application-side authorization or revocation matters.

Diagnostics

Run a read-only check:

php glueful storage:test gcs

Run a write/read/delete smoke test only when you want to verify write permissions:

php glueful storage:test gcs --write

Development

composer test
composer run analyze
composer run phpcs

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固