onoi/blob-store 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

onoi/blob-store

最新稳定版本:1.2.1

Composer 安装命令:

composer require onoi/blob-store

包简介

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

关键字:

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Packagist download count Dependency Status

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.

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

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.

{
	"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.

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.

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.

Release notes

  • 1.2.0 (2016-03-19)
  • 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)
  • Removed tracking of internal ID list
  • Added Container::setExpiryInSeconds
  • 1.0.0 (2015-06-02)
  • Initial release

License

GNU General Public License 2.0 or later.

统计信息

  • 总下载量: 478.74k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固