Last active
December 10, 2015 14:18
-
-
Save ralph-tice/4446893 to your computer and use it in GitHub Desktop.
how to use aws-sdk-php v2.x with dynamodb session handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Include the SDK along with your other project dependencies | |
// using the Composer autoloader | |
require 'vendor/autoload.php'; | |
use Aws\Common\Aws; | |
use Aws\Common\Enum\Region; | |
use Aws\DynamoDb\Exception\DynamoDbException; | |
$aws = Aws::factory(array( | |
'key' => 'aws_key_here', | |
'secret' => 'my-secret-here', | |
'region' => Region::US_EAST_1 | |
)); | |
$dynamodb = $aws->get('dynamodb'); | |
$handler = $dynamodb->registerSessionHandler(array( | |
'table_name' => 'my-sessions-table-name' | |
)); | |
$handler->createSessionsTable(5,5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is intended to replace http://aws.typepad.com/aws/2012/04/scalable-session-handling-in-php-using-amazon-dynamodb.html
also relates to aws/aws-sdk-php#26