PHP code example of moderntribe / tribe-storage-aws-s3

1. Go to this page and download the library: Download moderntribe/tribe-storage-aws-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/ */

    

moderntribe / tribe-storage-aws-s3 example snippets


define( 'TRIBE_STORAGE_ADAPTER', \Tribe\Storage\Adapters\S3_Adapter::class );
define( 'TRIBE_STORAGE_S3_BUCKET', 'mybucketname' );

define( 'TRIBE_STORAGE_S3_OPTIONS', [
	'credentials' => [
		'key'    => 'YOUR-KEY',
		'secret' => 'YOUR-SECRET-KEY',
	],
	'region'      => 'us-east-1',
	'version'     => 'latest',
] );

// Ideally this should be a CDN URL
define( 'TRIBE_STORAGE_URL', 'https://s3-us-east-1.amazonaws.com/bucket/' . TRIBE_STORAGE_S3_BUCKET );