2017 © Pedro Peláez
 

library filespace

Flexible storage solution for end-user data

image

linkorb/filespace

Flexible storage solution for end-user data

  • Thursday, May 14, 2015
  • by joostfaassen
  • Repository
  • 3 Watchers
  • 2 Stars
  • 65 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

FileSpace

Flexible storage solution for end-user data., (*1)

, (*2)

Check out our blogpost to see how we're using it in production: http://engineering.linkorb.com/blog/scaling-user-data-with-objectstorage-in-php, (*3)

Installing

Check out composer for details about installing and running composer., (*4)

Then, add linkorb/filespace to your project's composer.json:, (*5)

{
    "require": {
        "linkorb/filespace": "~1.0"
    }
}

Usage:

use Aws\S3\S3Client;
use FileSpace\Service\PdoService;
use ObjectStorage\Adapter\S3Adapter;

// Instantiate an S3 connection
$s3client = S3Client::factory(array(
    'key' => 'my_s3_key',
    'secret' => 'my_s3_secret'
));

// Get a storage adapter based on the s3 client
$storage = new S3Adapter($s3client, 'my-bucket-name', 'my/key/prefix/');

// Get a PDO connection
$pdo = ... // TODO;

// Instantiate the File Space Service:
$service = new PdoFileSpaceService($pdo, $storage);

// test if a 'space' has been created:
$space_key = 'account-x.contact.c001';
if (!$service->hasSpace($space_key)) {
    $service->createSpace($space_key, "Customer 1: John Johnson");
}
$space = $service->getSpace($space_key);

// List all files in the space
$files = $service->getFiles($space);
foreach ($files as $file) {
    echo $file->getKey() . ': ' . $file->getSizeOriginalDisplay() . "\n";
}

// Upload a file into this space
$service->upload($space, 'contract-final.pdf', '/home/john/Downloads/contract.pdf');

// Download a file from this space:
$service->download($space, 'invoice-1234.pdf', '/home/john/invoices/invoice-1234.pdf');

// Delete a file from the space:
$service->deleteFile($space, 'remove-me.txt');


Initializing the database schema

vendor/bin/database-manager database:loadschema --apply filespace example/schema.xml

Contributing

Ready to build and improve on this repo? Excellent! Go ahead and fork/clone this repo and we're looking forward to your pull requests!, (*6)

If you are unable to implement changes you like yourself, don't hesitate to open a new issue report so that we or others may take care of it., (*7)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering., (*8)

Btw, we're hiring!, (*9)

License

Please check LICENSE.md for full license information, (*10)

The Versions

14/05 2015

dev-master

9999999-dev http://www.github.com/linkorb/filespace

Flexible storage solution for end-user data

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb s3 storage gridfs namespace objectstorage cloud storage filespace

09/05 2015

v1.3.0

1.3.0.0 http://www.github.com/linkorb/filespace

Flexible storage solution for end-user data

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb s3 storage gridfs namespace objectstorage cloud storage filespace

08/05 2015

v1.2.0

1.2.0.0 http://www.github.com/linkorb/filespace

Flexible storage solution for end-user data

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb s3 storage gridfs namespace objectstorage cloud storage filespace

08/05 2015

v1.1.0

1.1.0.0 http://www.github.com/linkorb/filespace

Flexible storage solution for end-user data

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb s3 storage gridfs namespace objectstorage cloud storage filespace

08/05 2015

v1.0.0

1.0.0.0 http://www.github.com/linkorb/filespace

Flexible storage solution for end-user data

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb s3 storage gridfs namespace objectstorage cloud storage filespace