PHP code example of skullyframework / skully-amazon-s3

1. Go to this page and download the library: Download skullyframework/skully-amazon-s3 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/ */

    

skullyframework / skully-amazon-s3 example snippets


    // Copy credentials.csv from AmazonS3 website into directory "config/AmazonS3/"
    $csv = file_get_contents(realpath(__DIR__.'/AmazonS3/credentials.csv'));
    $csv_r = explode("\n", $csv);
    $s3Config = explode(',', trim($csv_r[1]));
    $s3Config[0] = str_replace('"', '', $s3Config[0]);

    $config->setProtectedFromArray(array(
        'amazonS3' => array(
            'enabled' => true,
            'bucket' => 'skully-admin',
            'region' => 's3-ap-southeast-1',
            'settings' => array(
                'profile'=> $s3Config[0],
                'key'    => $s3Config[1],
                'secret' => $s3Config[2],
            )
        )
    ));