mead-steve/phlocal-dynamo

This package is abandoned and no longer maintained. No replacement package was suggested.

Helper for launching dynamo db for testing

v0.1.2 2016-01-16 09:50 UTC

This package is auto-updated.

Last update: 2021-03-29 06:14:57 UTC


README

Build Status

This package provides a wrapper for the DynamoDb.jar that is available from AWS for local deployment. It is intended to speed up development and testing with dynamo db.

The required dynamo library should be downloadable from here: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html

This package is a php port of a c# library from JUST EAT: https://github.com/justeat/LocalDynamoDb

Getting Started

Java is required as Amazon provide the local DynamoDb as a jar file.

Run composer require mead-steve/phlocal-dynamo

The DynamoDb.jar isn't included in this package to avoid licensing issues.
Add the contents of the zip/tar file from amazon in to vendor\MeadSteve\PhlocalDynamo\src\dynamo

Then in any test classes simply do the following

    $dynamo = new LocalDynamo(9091);
    $dynamo->start();

And to stop it

    $dynamo->stop();

Using PhlocalDynamo

Calling $dynamo->getClient() will return a dynamo client instance pointing to the local instance of dynamo.