evaneos/gringotts-sdk

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

SDK for Gringotts

v0.10.0 2016-11-21 13:37 UTC

This package is auto-updated.

Last update: 2020-08-16 12:11:52 UTC


README

Evaneos assets storage SDK

Installation

In order to be up and running with the SDK you'll need to require it via composer

composer require evaneos/gringotts-sdk

and then create a new instance with the URL of your Gringotts instance :

$gringotts = new GringottsClient('http://your-gringotts-instance.com');

Storing an asset

Gringotts SDK allows to store assets through different forms : String, PHP resource or PSR StreamInterface and will respond with the asset id.

$gringotts = new GringottsClient('http://your-gringotts-instance.com');

$assetId = $gringotts->store('Some data as string');

You can even force your own uuid:

$assetId = $gringotts->storeWithId('871CDC92-A75B-43E7-A38E-FC22AA5450CA', 'Some data as string');

Retrieving an asset

You can retrieve a previously stored asset using the id provided while storing it. Gringotts SDK will return a stream implementing PSR StreamInterface.

$gringotts = new GringottsClient('http://your-gringotts-instance.com');

$asset = $gringotts->get('871CDC92-A75B-43E7-A38E-FC22AA5450CA');