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
Requires
- guzzlehttp/guzzle: ^6.1
- league/flysystem: ^1.0
- ramsey/uuid: ^3.1
Requires (Dev)
- phake/phake: ^2.2
- phing/phing: ^2.13
- phpunit/phpunit: ^4.8
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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');