定制 spacecatninja/imager-x-gcs-storage-driver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

spacecatninja/imager-x-gcs-storage-driver

最新稳定版本:1.0.0

Composer 安装命令:

composer require spacecatninja/imager-x-gcs-storage-driver

包简介

External storage driver for Imager X that integrates with Google Cloud Services

README 文档

README

External storage driver for Imager X that uploads transformed images to Google Cloud Storage.

Requirements

  • Craft CMS 5.0.0 or later
  • Imager X 6.0.0 or later (Pro edition)

Installation

composer require spacecatninja/imager-x-gcs-storage-driver
php craft plugin/install imager-x-gcs-storage-driver

Configuration

Add a gcs key to storageConfig in your config/imager-x.php:

'storages' => ['gcs'],

'storageConfig' => [
    'gcs' => [
        'keyFile' => '',
        'bucket' => 'my-bucket',
        'folder' => 'transforms',
    ],
],

Point imagerUrl at your bucket:

'imagerUrl' => 'https://storage.googleapis.com/my-bucket/transforms/',

Always flush your Imager transforms cache when adding or removing external storages, as existing cached transforms will not be re-uploaded.

Configuration options

Option Default Description
keyFile '' Service account credentials as a JSON string, a path to a JSON key file, or an environment variable reference (e.g. $GCS_KEY).
bucket '' GCS bucket name.
folder '' Folder prefix within the bucket.

Authentication

The keyFile setting accepts two formats:

JSON string — pass the service account JSON directly (or via an environment variable):

'keyFile' => '$GOOGLE_APPLICATION_CREDENTIALS_JSON',

File path — pass the path to a service account key file:

'keyFile' => '/var/secrets/gcs-key.json',

Uploaded objects are set to publicRead ACL. Make sure your bucket is configured to allow public access if you intend to serve transforms directly from GCS.

Price, license and support

The plugin is released under the MIT license. It requires Imager X Pro, which is a commercial plugin available in the Craft plugin store.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固