chella / aws-services
amazon service tnq
Installs: 214
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/chella/aws-services
Requires
- aws/aws-sdk-php: ^3.87
 
README
Application with Slim Framework
Installation
Use Composer
Do Composer Require as below
composer require chella/aws-services
Setup S3
try {
    $s3 = App::get("fileSystemS3", [
        "key"=>"###",
        "secret" => "###",
        "bucket" => "###",
        "region" => "###"
    ]);
}
catch (Exception $e) {
    echo $e->getMessage() . "\n";
}
Setup Minio
try {
    $minio = App::get("minioFileSystem", [
        'version' => 'latest',
        'region'  => 'us-east-1',
        'endpoint' => 'http://localhost:9000',
        'use_path_style_endpoint' => true,
        'credentials' => [
            'key' => '###',
            'secret' => '###',
        ],
        'bucket' => '###',
    ]);
    ## for writing content over minio server
    ## 1st arg is filename
    ## 2nd arg is content
    $minio->write('sample.txt', 'hello minio test');
    ## for read content over minio server
    ## 1st arg is filename
    echo $minio->read('sample.txt');
    ## for delete content over minio server
    ## 1st arg is filename
    echo $minio->delete('sample.txt');
}
catch (Exception $e) {
    echo $e->getMessage() . "\n";
}
Minio docker documentation
https://registry.hub.docker.com/r/minio/minio/
docker run command
docker run -e MINIO_ROOT_USER=admin -e MINIO_ROOT_PASSWORD=chella#321 -p 9000:9000 -p 9001:9001 --name cloudS3local minio/minio server /data --console-address ":9001"
Here you go
Happy coding.