Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Storage interface #47

@hexus

Description

@hexus

The Storage package needs a storage interface that can have Readable, Modifiable and other storage types plugged into it.

This would allow for behaviour like so:

$storage = new Storage([
    'create' => new SomeCreatableStorage(),
    'read'   => new SomeReadableStorage(),
    'modify' => new SomeModifiableStorage()
]);

$storage->readFrom(new SomeOtherReadableStorage());
$storage->searchFrom(new SomeSearchableStorage());

if (!$storage->canRead()) {
    throw new \RuntimeException('Storage is not readable!');
}

Perhaps by default the storage could assume everything capable from a single source, too:

$storage = new Storage(new DatabaseStorage($connection));

Sources could then be overridden afterwards if need be.

Maybe this needs a different name too, this is basically like a MultiStorage adapter. Or maybe the source interfaces should be renamed.

Work this out into a perfect set of interfaces and this will be one hell of an expressive system.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions