spacecatninja/imager-x-aws-storage-driver 问题修复 & 功能扩展

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

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

spacecatninja/imager-x-aws-storage-driver

Composer 安装命令:

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

包简介

External storage driver for Imager X that integrates with AWS (S3)

README 文档

README

External storage driver for Imager X that uploads transformed images to Amazon S3. Supports CloudFront cache invalidation and credential-less authentication for ECS/EC2 environments.

Requirements

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

Installation

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

Configuration

Add an aws key to storageConfig in your config/imager-x.php:

'storages' => ['aws'],

'storageConfig' => [
    'aws' => [
        'accessKey' => '',
        'secretAccessKey' => '',
        'region' => 'eu-west-1',
        'bucket' => 'my-bucket',
        'folder' => 'transforms',
        'storageType' => 'standard',
        'requestHeaders' => [],
        'disableACL' => false,
        'public' => true,
        'cloudfrontInvalidateEnabled' => false,
        'cloudfrontDistributionId' => '',
    ],
],

Point imagerUrl at your bucket (or CloudFront distribution):

'imagerUrl' => 'https://my-bucket.s3.eu-west-1.amazonaws.com/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
accessKey '' AWS access key ID. Supports environment variables (e.g. $AWS_ACCESS_KEY).
secretAccessKey '' AWS secret access key. Supports environment variables.
region '' AWS region (e.g. eu-west-1).
bucket '' S3 bucket name. Supports environment variables.
folder '' Folder prefix within the bucket.
storageType 'standard' S3 storage class. Accepts standard, rrs (Reduced Redundancy), or glacier.
requestHeaders [] Additional headers merged into the S3 putObject request (e.g. Content-Encoding).
disableACL false Set to true to skip setting an ACL on upload (required for buckets with ACLs disabled).
public true When ACL is enabled, sets objects to public-read. Set to false for private.
cloudfrontInvalidateEnabled false Send a CloudFront invalidation request after each upload.
cloudfrontDistributionId '' CloudFront distribution ID to invalidate.
useCredentialLessAuth false Skip access key credentials and rely on IAM roles instead (web identity, ECS, or EC2 instance profile).

Credential-less authentication

When running on AWS infrastructure (ECS, EC2, or with web identity federation), you can omit accessKey and secretAccessKey and let the SDK resolve credentials from the environment automatically:

'aws' => [
    'useCredentialLessAuth' => true,
    'region' => 'eu-west-1',
    'bucket' => 'my-bucket',
    'folder' => 'transforms',
],

The driver checks for AWS_WEB_IDENTITY_TOKEN_FILE/AWS_ROLE_ARN (web identity), AWS_CONTAINER_CREDENTIALS_RELATIVE_URI (ECS), and falls back to the EC2 instance metadata service.

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.

spacecatninja/imager-x-aws-storage-driver 适用场景与选型建议

spacecatninja/imager-x-aws-storage-driver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 450 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「s3」 「cms」 「aws」 「Craft」 「craftcms」 「craft-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 spacecatninja/imager-x-aws-storage-driver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 spacecatninja/imager-x-aws-storage-driver 我们能提供哪些服务?
定制开发 / 二次开发

基于 spacecatninja/imager-x-aws-storage-driver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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