Giter Club home page Giter Club logo

dynamo-session-bundle's Introduction

DynamoDb Session Handler bundle

This Symfony 2.1 bundle allows you to use the DynamoDb Web Service to store your sessions

Installation

Simply add the following to your composer.json file

{
    "require": {
        "gwk/dynamo-session-bundle": "0.*"
    }
}

And use composer to install the bundle:

composer.phar update gwk/dynamo-session-bundle

Now add the bundle to your app/AppKernel.php:

$bundles[] = new GWK\DynamoSessionBundle\GWKDynamoSessionBundle();

Configuration

Add the following configuration setting to your app/config/config.yml

framework:
    session:
        handler_id: dynamo_session_handler

gwk_dynamo_session:
    table: my_session_table # DynamoDb Table to store sessions in
    locking_strategy: pessimistic # See AWS PHP documentation for valid values
    # dynamo_client_id: my_dynamodb_service # If you already use DynamoDb and you have a AWS\DynamoDb\DynamoDbClient service, you can make the session handler use it
    automatic_gc: true # Whether to use PHP's internal automatic garbage collection. The AWS sdk doesn't recommend it but doesn't explain why
    gc_batch_size: 25 # Maximum number of sessions the garbage collector deletes when garbage collection is started (manually or automatic)
    session_lifetime: 3600 # Number of seconds after which idle sessions should be garbage collected
    read_capacity: 10 # Default read capacity
    write_capacity: 10 # Default write capacity
    aws:
        region: us-east-1 # AWS Region to use
        version: latest # AWS API version
        key: AKA123456789 # Your AWS key
        secret: abcdeffhij # Your AWS secret

If you use AWS IAM Roles and your instance's permissions allow access to the appropriate DynamoDb Table you can leave out the credentials.

If the table does not exist the bundle will create the table for you with the specified capacities. Once the table is created the capacity configuration values are no longer used (unless the table is deleted).

FAQ

Fixing cURL error #77

Certain versions of CentOS AWS AMIs may need this additional php.ini configuration to fix this exception:

curl.cainfo="/etc/ssl/certs/ca-bundle.crt" 

Source: http://stackoverflow.com/a/26269489

License

MIT, See LICENSE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.