wieni/flysystem_s3

此包的最新版本(2.0.2)没有提供许可证信息。

安装次数: 2,381

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 3

分支: 0

开放性问题: 0

类型:drupal-module

2.0.2 2024-03-16 12:13 UTC

This package is auto-updated.

Last update: 2024-09-16 13:23:27 UTC


README

设置说明请参阅 Flysystem README.md。

配置

区域需要设置为区域ID,而不是区域名称。以下是区域名称及其对应ID的列表

s3-cors-example.json 文件包含一个模板,您可以使用该模板通过REST API或使用aws s3api put-bucket-cors命令来配置CORS。

示例配置

$schemes = [
  's3' => [
    'driver' => 's3',
    'config' => [
      'key'    => '[your key]',      // 'key' and 'secret' do not need to be
      'secret' => '[your secret]',   // provided if using IAM roles.
      'region' => '[aws-region-id]',
      'bucket' => '[bucket-name]',

      // Optional configuration settings.

      // 'options' => [
      //   'ACL' => 'public-read',
      //   'StorageClass' => 'REDUCED_REDUNDANCY',
      // ],

      // 'protocol' => 'https',                   // Autodetected based on the
                                                  // current request if not
                                                  // provided.

      // 'prefix' => 'an/optional/prefix',        // Directory prefix for all
                                                  // uploaded/viewed files.

      // 'cname' => 'static.example.com',         // A CNAME that resolves to
                                                  // your bucket. Used for URL
                                                  // generation.

      // 'cname_is_bucket' => TRUE,               // Set to FALSE if the CNAME
                                                  // does not resolve to a
                                                  // bucket and the bucuket
                                                  // should be included in the
                                                  // path.

      // 'endpoint' => 'https://api.example.com', // An alternative API endpoint
                                                  // for 3rd party S3 providers.

      // 'public' => TRUE,                        // Set to TRUE to link to files
                                                  // using direct links.

      // 'cors' => TRUE,                          // Set to TRUE if CORS upload
                                                  // support is enabled for the
                                                  // bucket.
    ],

    'cache' => TRUE, // Creates a metadata cache to speed up lookups.
  ],
];

$settings['flysystem'] = $schemes;