treehouselabs/swift-client

Client for the Swift object store protocol

Installs: 1 130

Dependents: 0

Watchers: 6

Forks: 1

Open Issues: 1

Language: PHP

v1.0.1 2015-05-18 14:02 UTC

README

Build Status Code Coverage Scrutinizer Code Quality

Installation

composer require treehouselabs/swift-client:~1.0

Usage

use TreeHouse\Keystone\Client\ClientFactory;
use TreeHouse\Keystone\Client\Model\Tenant;

// use `treehouselabs/keystone-client` to initialize a Guzzle Client that can
// communicate with Keystone-authenticated services
$driver = new SwiftDriver($client);
$store  = new ObjectStore($driver);

// create a new container and object
$container = $store->createContainer('foo');
$object = $store->createObject($container, 'bar');

// set a local file to the object
$object->setLocalFile($file);

// update the object in the store
$store->updateObject($object);


// ...

// get the stored container/object
$container = $store->getContainer('foo');
$object = $container->getObject('bar);

// get the contents
$store->getObjectContent($object);