Download the PHP package cusodede/yii2-s3-module without Composer
On this page you can find all versions of the php package cusodede/yii2-s3-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-s3-module
yii2-s3-module
S3 support module (file-manager and stuff).
Installation with Composer
Run
or add
to the require section of your composer.json
file.
Module migration
Module needs to store file data in database tables, which will be created by
command. You can customize table names by define tableName
and tagsTableName
parameters in module
configuration.
Configuration parameters
See example config below:
How to handle multiple connections to different S3 servers?
It is possible to configure multiple named connections in params.connection
section:
and use them like this:
or
connection
parameter can be skipped, even for multiple connections configurations. In that case first
connection in list will be used.
How to handle stream uploads via multipart/form-data?
At first, configure MultipartFormDataParser as request parser for multipart/form-data:
that's all. Now it is possible to do stream uploads via PUT
method. You can use an any proper JS-based
widget (like limion/yii2-jquery-fileupload-widget
) to do this. See also views/index/put.php for example.
Local tagging
It is possible to mark uploads with tags, what may be used for quick searches. Tags will be stored in the
local table and also will be assigned to S3 object. But it works only to one side: tags from S3 objects will
not be synchronized to local table. It is possible to sync local and remote tags, see
CloudStorage::syncTagsFromS3()
and CloudStorage::syncTagsToS3()
methods.
Development and Testing
Prerequisites
- Docker and Docker Compose
- PHP 8.1+ (for local development)
Running Tests
This project supports testing with PHP 8.1 and PHP 8.4 using Docker containers.
Docker Testing (Recommended)
The project uses a unified Docker environment for both development and testing. Services are started once and reused between test runs for maximum efficiency.
Quick Start:
Detailed Commands:
Windows Testing
Windows users can use the same make
commands if they have Docker Desktop and Git Bash, or use Docker Compose directly:
Local Testing (Without Docker)
Requirements:
- PHP 8.1+
- PostgreSQL
- MinIO server
-
Copy and configure environment:
-
Install dependencies:
- Run tests:
Test Environment
Continuous Integration
Tests run automatically on GitHub Actions for PHP 8.1 and 8.4 with:
- PostgreSQL 13.4 database service
- MinIO S3-compatible storage service
- All required PHP extensions (zip, pdo_pgsql, sockets, bcmath, pcntl, intl, mbstring)
Local Docker Testing
The Docker setup includes:
- PHP 8.1/8.4 containers with all required extensions
- PostgreSQL for database testing
- MinIO S3-compatible storage server
Test configuration is defined in:
codeception.yml
- Main test configurationtests/*.suite.yml
- Test suite configurationstests/.env
- Test environment variablestests/.env.ci
- CI environment variablesdocker-compose.yml
- Unified Docker environmentdocker/
- PHP container definitions
All versions of yii2-s3-module with dependencies
aws/aws-sdk-php Version ^3.208
pozitronik/yii2-traits Version ^1.0.5
pozitronik/yii2-badgewidget Version ^2.0.0
kartik-v/yii2-widget-select2 Version ^2.2.3