Skip to content

Commit bbc81e7

Browse files
committed
Setting up S3 Client
1 parent 635cd6d commit bbc81e7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

inc/s3Client.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use Aws\S3\S3Client;
4+
5+
// Bring in the config data
6+
if (file_exists(dirname(__FILE__) . "/config.php")) {
7+
require_once dirname(__FILE__) . "/config.php";
8+
} else {
9+
require_once dirname(__FILE__) . "/config.env.php";
10+
}
11+
12+
require __DIR__.'/vendor/autoload.php';
13+
14+
global $S3_KEY, $S3_SECRET, $S3_SERVER;
15+
16+
$client = new S3Client([
17+
'region' => '',
18+
'version' => '2006-03-01',
19+
'endpoint' => $S3_SERVER,
20+
'credentials' => [
21+
'key' => $S3_KEY,
22+
'secret' => $S3_SECRET
23+
],
24+
'use_path_style_endpoint' => true
25+
]);

0 commit comments

Comments
 (0)