shinjin/freezer

A cool object storage library

0.6 2018-04-06 02:40 UTC

This package is not auto-updated.

Last update: 2024-05-12 03:51:51 UTC


README

Build Status Coverage Status

A cool object storage library.

Use freezer if you need:

  • an easy way to store and fetch objects and object graphs
  • a schemaless datastore with drivers for PDO, DoctrineCache, and CouchDB

Install

Via Composer

$ composer require shinjin/freezer

Usage

use Freezer\Storage\Pdo;

$storage = new Pdo(array('driver' => 'sqlite'));

$caveman = new class
{
    public $name        = 'Brendan';
    public $nationality = 'Canadian';
};

$id = $storage->store($caveman);

// wait 2 million years

$caveman = $storage->fetch($id);

print_r($caveman);

// class@anonymous Object
// (
//     [name] => Brendan
//     [nationality] => Canadian
// )

See Usage and Old README for the original writeup.

Change log

See CHANGELOG.

Testing

$ composer test

Contributing

Bugfixes are welcome. Please submit pull requests to Github.

Authors

License

The MIT License (MIT). Please see License File for more information.

Acknowledgements

Freezer is based on php-object-freezer by Sebastian Bergmann. Most of freezer's core and test code is his. Sebastian Bergmann is not affiliated with this project in any way, shape, or form.