-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathderek.php
More file actions
40 lines (36 loc) · 873 Bytes
/
derek.php
File metadata and controls
40 lines (36 loc) · 873 Bytes
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
<?php
require './lib/php/aws/aws-autoloader.php';
use \Aws\DynamoDb\DynamoDbClient;
$client = \Aws\DynamoDb\DynamoDbClient::factory(array(
'credentials' => [
'key' => 'cs452',
'secret' => 'cs452',
],
'version' => '2012-08-10',
'region' => 'us-west-2',
'endpoint' => 'http://localhost:8000'
));
//$result = $client->putItem([
// 'Item' => [
// 'filename' => [
// 'S' => 'fakeFile.png',
// ],
// 'user_id' => [
// 'S' => 'fakeEmail@example.com',
// ],
// ],
// 'ReturnConsumedCapacity' => 'TOTAL',
// 'TableName' => 'Image',
//]);
$result = $client->getItem([
'Key' => [
'filename' => [
'S' => 'derek.png',
],
'user_id' => [
'S' => 'dereks_is',
],
],
'TableName' => 'Image',
]);
echo $result->get('Key');