composer require pieceofcake2/aws
Config/core.php
Configure::write('Session', [
'defaults' => 'php',
'handler' => [
'engine' => 'Aws.DynamoDbSession',
'table_name' => 'DYNAMODB_TABLE_NAME'
],
'timeout' => 1440,
'ini' => [
'session.cookie_lifetime' => 0,
'session.gc_maxlifetime' => 2580000,
'session.gc_probability' => 1,
'session.gc_divisor' => 100,
],
]);
/*
* Aws
*/
Configure::write('Aws', [
'region' => 'ap-northeast-1',
'version' => 'latest',
]);
Config/email.php
class EmailConfig
{
/**
* Default email profile values.
*
* @var array
*/
public $default = [
'transport' => 'Aws.AmazonSesApi',
'from' => 'example@example.com',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
];
}
$client = new Aws\S3\S3Client(Configure::read('Aws'));
$client->registerStreamWrapperV2();
or
CakePlugin::load('Aws', [
'bootstrap' => true,
]);