PHP code example of ilhamarrouf / slim-filesystem

1. Go to this page and download the library: Download ilhamarrouf/slim-filesystem library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ilhamarrouf / slim-filesystem example snippets


$settings = [
    'settings' => [
        'filesystem' => [
            'default' => 'cloud',
            'cloud' => 'minio',
            'disks' => [
                'public' => [
                    'driver' => 'local',
                    'root' => __DIR__.'/storage/',
                    'url' => $_SERVER['HTTP_HOST'].'/storage',
                    'visibility' => 'public',
                ],
                's3' => [
                    'driver' => 's3',
                    'key' => 'superkey',
                    'secret' => 'supersecret',
                    'region' => 'us-east-1',
                    'bucket' => 'test',
                    'url' => 'http://host-to-aws-s3',
                ],
                'minio' => [
                    'driver' => 's3',
                    'endpoint' => '127.0.0.1:9000',
                    'use_path_style_endpoint' => true,
                    'key' => 'superpersonalket',
                    'secret' => 'superpersonalsecret',
                    'region' => 'us-east-1',
                    'bucket' => 'tms',
                ],
            ]
        ],
    ],
];

$app = new \Slim\App($settings);

$container = $app->getContainer();

$container['storage'] = function ($container) {
    return new \Ilhamarrouf\Filesystem\FilesystemManager($container);
};