2017 © Pedro Peláez
 

library blob-store

A simple interface to manage schema-free temporal persistent key/values

image

onoi/blob-store

A simple interface to manage schema-free temporal persistent key/values

  • Saturday, January 20, 2018
  • by onoi
  • Repository
  • 1 Watchers
  • 1 Stars
  • 119,697 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 5 % Grown

The README.md

Blob store

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Packagist download count Dependency Status, (*1)

A simple interface to manage schema-free temporal persistent key/values. This was part of the Semantic MediaWiki code base and is now being deployed as independent library., (*2)

It is suggested to use either redis, riak, or mongodb as back-end provider depending on the use case., (*3)

Requirements

  • PHP 5.3 or later
  • Onoi/Cache ~1.1

Installation

The recommended installation method for this library is by either adding the dependency to your composer.json., (*4)

{
    "require": {
        "onoi/blob-store": "~1.2"
    }
}

Usage

class Foo {

    private $blobStore;

    public function __construct( BlobStore $blobStore ) {
        $this->blobStore = $blobStore;
    }

    public function doSomethingFor( $id ) {
        $container = $this->blobStore->read( md5( $id ) );

        $container->set( 'one', array( new \stdClass, 'Text' ) );

        $container->append(
            'one',
            new \stdClass
        );

        $container->delete( 'two' );

        $this->blobStore->save( $container );
    }
}
$cacheFactory = new CacheFactory();

$compositeCache = $cacheFactory->newCompositeCache( array(
    $cacheFactory->newFixedInMemoryLruCache(),
    $cacheFactory->newDoctrineCache( new \Doctrine\Common\Cache\RedisCache( ... ) )
) );

or

$compositeCache = $cacheFactory->newCompositeCache( array(
    $cacheFactory->newFixedInMemoryLruCache(),
    $cacheFactory->newMediaWikiCache( \ObjectCache::getInstance( 'redis' ) )
) );

$blobStore = new BlobStore( 'foo', $compositeCache );

$instance = new Foo( $blobStore );
$instance->doSomethingFor( 'bar' );

When creating an instance a namespace is required to specify the context of the storage in case the BlobStore is used for different use cases., (*5)

Contribution and support

If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the contribution guidelinee. A list of people who have made contributions in the past can be found here., (*6)

Tests

The library provides unit tests that covers the core-functionality normally run by the continues integration platform. Tests can also be executed manually using the composer phpunit command from the root directory., (*7)

Release notes

  • 1.2.0 (2016-03-19), (*8)

    • Added Container::addToLinkedList to maintain a linked list of interdependent containers (if the original container is removed then all linked containers will be expunged as well)
  • 1.1.0 (2015-06-13), (*9)

    • Removed tracking of internal ID list
    • Added Container::setExpiryInSeconds
  • 1.0.0 (2015-06-02), (*10)

    • Initial release

License

GNU General Public License 2.0 or later., (*11)

The Versions

20/01 2018

dev-master

9999999-dev https://github.com/onoi/blob-store

A simple interface to manage schema-free temporal persistent key/values

  Sources   Download

GPL-2.0+ GPL-2.0-or-later

The Requires

 

messages

09/07 2016

1.2.1

1.2.1.0 https://github.com/onoi/blob-store

A simple interface to manage schema-free temporal persistent key/values

  Sources   Download

GPL-2.0+

The Requires

 

messages

19/03 2016

1.2.0

1.2.0.0 https://github.com/onoi/blob-store

A simple interface to manage schema-free temporal persistent key/values

  Sources   Download

GPL-2.0+

The Requires

 

messages

13/06 2015

1.1.0

1.1.0.0 https://github.com/onoi/blob-store

A simple interface to manage schema-free temporal persistent key/values

  Sources   Download

GPL-2.0+

The Requires

 

messages

02/06 2015

1.0.0

1.0.0.0 https://github.com/onoi/blob-store

A simple interface to manage schema-free temporal persistent key/values

  Sources   Download

GPL-2.0+

The Requires

 

messages