__construct ( $dynamodb, $options )

Initializes the session handler and prepares the configuration options.

Access

public

Parameters

Parameter

Type

Required

Description

$dynamodb

AmazonDynamoDB

Required

An instance of the DynamoDB client.

$options

array

Optional

Configuration options.

Source

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

public function __construct(AmazonDynamoDB $dynamodb, array $options = array())
{
    // Store the AmazonDynamoDB client for use in the session handler
    $this->_dynamodb = $dynamodb;

    // Do type conversions on options and store the values
    foreach ($options as $key => $value)
    {
        if (isset(self::$_option_types[$key]))
        {
            settype($value, self::$_option_types[$key]);
            $this->{'_' . $key} = $value;
        }
    }

    // Make sure the lifetime is positive. Use the gc_maxlifetime otherwise
    if ($this->_session_lifetime <= 0)
    {
        $this->_session_lifetime = (integer) ini_get('session.gc_maxlifetime');
    }
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback