ciims-plugins/awsuploader

CiiMS的AWS S3上传插件

1.0.3 2015-03-28 18:56 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:31:52 UTC


README

此类使CiiMS能够将文件上传到Amazon S3,而不是上传到上传目录

安装

应使用composer安装此类。安装/上传CiiMS后,运行此类

# composer require ciims-plugins/awsuploader dev-master # DEV
composer require ciims-plugins/awsuploader 1.0.0 # Versioned

使用方法

要使用此类,您需要更改您的protected/config/params.php文件中的配置。

<?php return array(

	[...]
	'ciims_plugins' => array(
		'upload' => array(
			'class' => 'CiiAWSUploader',
			'options' => array(
				'bucket' => ''
				'AWS_ACCESS_KEY' => '',
				'AWS_SECRET_ACCESS_KEY' => '',
				'region' => '', // required; @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
				'cdn_domain' => 'https://cdn.example.com' // set to NULL if not used, if set, no trailing slash
			)
		)
	)
	[...]
);

选项

此类有以下选项可用

AWS_ACCESS_KEY (必需)

您的AWS访问密钥

AWS_SECRET_ACCESS_KEY (必需)

您的AWS密钥

bucket (必需)

存储桶名称

cdn_domain (可选)

如果您在AWS前有一个自定义域名,可以在这里指定。CiiMS将使用此域名作为CDN URL,而不是默认的AWS域名