aimeos/ai-filesystem

Aimeos 文件系统层扩展

安装次数: 22,578

依赖者: 1

建议者: 0

安全: 0

星标: 9

关注者: 6

分支: 2

公开问题: 0

类型:aimeos-extension


README

Aimeos logo

Aimeos 文件系统扩展

Build Status Coverage Status Scrutinizer Code Quality License

Aimeos 文件系统扩展包含存储文件在云端、远程服务器或其他存储设施的适配器。

目录

安装

与其他 Aimeos 扩展一样,最简单的方式是通过 composer 安装。如果您还没有安装 composer,可以在命令行上执行以下字符串来下载它

php -r "readfile('https://getcomposer.org.cn/installer');" | php -- --filename=composer

然后,使用 composer 安装扩展

composer req aimeos/ai-filesystem

配置

所有文件系统适配器都配置在 resource/fs 配置键下,例如在您的配置文件的资源部分

'resource' => [
	'fs' => [
		// file system adapter specific configuration
	],
],

Amazon S3

所需适配器

composer req league/flysystem-aws-s3-v3

配置

'fs' => [
	'adapter' => 'FlyAwsS3',
	'credentials' => [
		'key' => 'your-key',
		'secret' => 'your-secret',
	],
	'region' => 'your-region',
	'version' => 'latest|api-version',
	'bucket' => 'your-bucket-name',
	'prefix' => 'your-prefix', // optional
	'baseurl' => 'https://your-s3-endpoint' // 'https://bucket-name.s3.us-east-2.amazonaws.com'
],

Azure

所需适配器(仅限 PHP 8.x)

composer req league/flysystem-azure-blob-storage

配置

'fs' => [
	'adapter' => 'FlyAzure',
	'endpoint' => 'DefaultEndpointsProtocol=https;AccountName=your-account;AccountKey=your-api-key',
	'container' => 'your-container',
	'prefix' => 'your-prefix', // optional
],

Dropbox

所需适配器

composer req spatie/flysystem-dropbox

配置

'fs' => [
	'adapter' => 'FlyDropbox',
	'accesstoken' => 'your-access-token'
],

FTP

所需适配器

composer req league/flysystem-ftp

配置

'fs' => [
	'adapter' => 'FlyFtp',
	'host' => 'your-hostname-or-ipaddress',
	'username' => 'your-username',
	'password' => 'your-password',
	'root' => '/path/to/basedir',
	'port' => 21, // optional
	'passive' => true, // optional
	'ssl' => true, // optional
	'timeout' => 30, // optional
	'utf8' => false, // optional
	'transferMode' => FTP_BINARY, // optional
	'systemType' => null, // 'windows' or 'unix'
	'ignorePassiveAddress' => null, // true or false
	'timestampsOnUnixListingsEnabled' => false, // true or false
	'recurseManually' => true // true
],

Google Cloud

所需适配器

composer req league/flysystem-google-cloud-storage

配置

'fs' => [
	'adapter' => 'FlyGoogleCloud',
	'keyFile' => json_decode(file_get_contents('/path/to/keyfile.json'), true), // alternative
	'keyFilePath' => '/path/to/keyfile.json', // alternative
	'projectId' => 'myProject', // alternative
	'prefix' => 'your-prefix' // optional
],

有关身份验证详情,请参阅 Google Cloud 客户端文档

本地

配置

'fs' => [
	'adapter' => 'FlyLocal',
	'basedir' => 'your-basedir-path',
],

内存

所需适配器

composer req league/flysystem-memory

配置

'fs' => [
	'adapter' => 'FlyMemory',
],

SFTP

所需适配器

composer req league/flysystem-sftp

配置

'fs' => [
	'adapter' => 'FlySftp',
	'host' => 'your-hostname-or-ipaddress',
	'port' => 22, // optional
	'username' => 'your-username', // optional
	'password' => 'your-password', // optional
	'privateKey' => 'path/to/or/contents/of/private/key', // optional
	'passphrase' => 'passphrase-for-the-private-key', // optional
	'fingerprint' => 'fingerprint-string', // optional
	'timeout' => 10, // optional
	'retry' => 4, // optional
	'agent' => true // optional
],

WebDAV

所需适配器(仅限 PHP 8.x)

composer req league/flysystem-webdav

配置

'fs' => [
	'adapter' => 'FlyWebdav',
	'baseUri' => 'your-webdav-uri',
	'proxy' => 'your-proxy', // optional
	'userName' => 'your-username', // optional
	'password' => 'your-password', // optional
	'authType' => 'authentication-type', // optional, 1=Basic, 2=Digest, 4=NTLM
	'encoding' => 'encoding-type', // optional, 1=None, 2=Deflate, 4=Gzip, 7=All
	'prefix' => 'your-prefix', // optional
],

Zip 存档

所需适配器

composer req league/flysystem-ziparchive

配置

'fs' => [
	'adapter' => 'FlyZip',
	'filepath' => '/path/to/zipfile',
],

许可

Aimeos 文件系统扩展根据 LGPLv3 开源许可协议授权,并可免费使用。

链接