humaninitiative/yii2-minio-component

A Yii2 component to interact with MinIO using AWS SDK.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:yii2-extension

pkg:composer/humaninitiative/yii2-minio-component

1.0 2025-11-17 00:36 UTC

This package is auto-updated.

Last update: 2025-11-17 00:39:03 UTC


README

Ini adalah komponen sisi server untuk akses ke MinIO.

Fitur

Bucket (check, create, policy)

Folder (create)

File (upload, delete, check)

Get Pre-Signed URL (private file)

Instalasi

1. Install via Composer

composer require humaninitiative/yii2-minio-component:"dev-master"

2. Config Aplikasi

Tambahkan pada .env :

MINIO_REGION={region}
MINIO_ENDPOINT={endpoint url} 
MINIO_KEY={user key}
MINIO_SECRET={user secret pass}
MINIO_DEFAULT_BUCKET={default bucket}

Lalu tambahkan pada config/web.php :

'components' => [
	'minio' => [
		'class' => 'humaninitiative\s3\MinioComponent',
		'version' => 'latest',
		'use_path_style_endpoint' => true,
		'region' => $_ENV['MINIO_REGION'],
		'endpoint' => $_ENV['MINIO_ENDPOINT'],
		'credentials' => [
			'key' => $_ENV['MINIO_KEY'],
			'secret' => $_ENV['MINIO_SECRET'],
		],
		'bucket' => $_ENV['MINIO_DEFAULT_BUCKET'],
	],
],

Copy FileController.php ke modules/api/controllers :

cp vendor/humaninitiative/yii2-minio-component/src/FileController.php modules/api/controllers/

Ubah namespace menjadi app\modules\api\controllers.