-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.php
53 lines (47 loc) · 1.44 KB
/
configure.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* Created by PhpStorm.
* User: russellstather
* Date: 06/09/15
* Time: 21:08
*/
use Aws\Credentials\Credentials;
use Aws\S3\S3Client;
require __DIR__ . '/vendor/autoload.php';
require_once 'generated-conf/config.php';
define("RSR", "com\\readysteadyrainbow\\");
define("ENTITYNS", "com\\readysteadyrainbow\\entities");
function MyAutoLoader($class){
if (substr_compare($class, ENTITYNS, 0, strlen(ENTITYNS)) == 0){
$path = __DIR__ . "/entities";
$toks = explode("\\", $class);
foreach ($toks as $item){
$path = $path . "/" . $item;
}
$path = $path . ".php";
if (file_exists($path)) {
include $path;
}
return;
}
if (substr_compare($class, RSR, 0, strlen(RSR)) == 0){
$toks = explode("\\", $class);
include __DIR__ . "/" . $toks[2] . "/" . $toks[3] . ".php";
return;
}
$start = strlen($class) - strlen("Controller");
if (substr_compare($class, "Controller", $start ) == 0){
include __DIR__ . "/controllers/" . $class . ".php";
return;
}
}
spl_autoload_register('MyAutoLoader');
date_default_timezone_set('UTC');
$credentials = new Credentials('AKIAJIYBZPTDIRPEDJRQ', 'vbJnztNWV1Aa/kqBax31EocVnv8ZvW0Q7ZYgzTtK');
// Instantiate an Amazon S3 client.
$s3 = new S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => $credentials
]);
\Aws\S3\StreamWrapper::register($s3);