Skip to content

Instantly share code, notes, and snippets.

@ralph-tice
Last active December 10, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralph-tice/4446893 to your computer and use it in GitHub Desktop.
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
<?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);
@ralph-tice
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment