承接 chillu/fakedatabase 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

chillu/fakedatabase

最新稳定版本:3.0.0

Composer 安装命令:

composer require --dev chillu/fakedatabase

包简介

Simple 'database' storage adapter which persists into a JSON file

README 文档

README

Build Status

Introduction

Simple "database" storage adapter which persists into a JSON file, making it easy to see the whole database state at a glance. It also carries all the benefits of "schema-less" storage, and doesn't have external dependencies on database drivers. This makes it useful for lightweight storage of test data, e.g. when recording and tracking data changes in integration tests.

The storage is optimized for developer readability as opposed to performance, since the file is persisted on disk every time a change is made.

Usage

// Instanciation
$db = new FakeDatabase('/tmp/my_database.json');

// Set a new object with the key 'john' (or override an existing one)
$db->set('User', 'john', new FakeObject(array(
	'email' => 'john@test.com', 
	'firstname' => 'John', 
	'address' => array(
		'street' => 'Test Road',
		'city' => 'Testington',
		'postcode' => 9999
	)
)));

// Update (merges with existing data through array_merge())
$db->update('User', 'john', new FakeObject(array('surname' => 'Test')));

// Get all objects for a certain type
$objs = $db->getAll('User');

// Get by key
$obj = $db->get('User', 'john');

// Simple find
$obj = $db->find('User', 'email', 'john@test.com');

// Complex find by dot notation
$obj - $db->find('User', 'address.postcode', 9999);

// Reset the whole database
$db->reset('User', 'address.postcode', 9999);

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2014-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固