-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbcode.php
More file actions
54 lines (40 loc) · 1.06 KB
/
dbcode.php
File metadata and controls
54 lines (40 loc) · 1.06 KB
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
54
<?php
/**
* Created by PhpStorm.
* User: NottyNerd
* Date: 06/09/2017
* Time: 09:24
*/
use Aws\DynamoDb\DynamoDbClient;
use Aws\S3\S3Client;
require 'vendor/autoload.php';
$config = require('config.php');
$s3 = DynamoDbClient::factory([
'key'=> $config['s3']['key'],
'secret'=> $config['s3']['secret'],
'region'=> $config['s3']['region'],
'version'=> $config['s3']['version'],
]);
$result = $s3->putObject(array(
'TableName' => '[Table_Name]'
));
print_r($result);
/**
$response = $client->putItem(array(
'TableName' => 'ExampleTable',
'Item' => array(
'Id' => array('S' => '104' ), // Primary Key
'Title' => array('S' => 'Book 104 Title' ),
'ISBN' => array('S' => '111-1111111111' ),
'Price' => array('N' => '25' ),
'Authors' => array('SS' => array('Author1', 'Author2') )
)
));
$response = $client->getItem(array(
'TableName' => 'ProductCatalog',
'Key' => array(
'Id' => array( 'S' => '104' )
)
));
print_r ($response['Item']);
*/