create_sessions_table ( $read_capacity_units, $write_capacity_units )

Creates a table in DynamoDB for session storage according to provided configuration options.

Note: Table creation may also be done via the AWS Console, which might make the most sense for this use case.

Access

public

Parameters

Parameter

Type

Required

Description

$read_capacity_units

integer

Optional

Read capacity units for table throughput.

$write_capacity_units

integer

Optional

Write capacity units for table throughput.

Returns

Type

Description

boolean

Returns true on success.

Source

Method defined in extensions/dynamodbsessionhandler.class.php | Toggle source view (18 lines) | View on GitHub

public function create_sessions_table($read_capacity_units = 10, $write_capacity_units = 5)
{
    $response = $this->_dynamodb->create_table(array(
        'TableName' => $this->_table_name,
        'KeySchema' => array(
            'HashKeyElement' => array(
                'AttributeName' => $this->_hash_key,
                'AttributeType' => AmazonDynamoDB::TYPE_STRING,
            )
        ),
        'ProvisionedThroughput' => array(
            'ReadCapacityUnits' => $read_capacity_units,
            'WriteCapacityUnits' => $write_capacity_units,
        )
    ));

    return $response->isOK();
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback