myaaghubi/mhm-json-db 问题修复 & 功能扩展

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

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

myaaghubi/mhm-json-db

最新稳定版本:v1.0

Composer 安装命令:

composer create-project myaaghubi/mhm-json-db

包简介

A lite JSON base database for PHP.

README 文档

README

UnitTest PHP Version Tested

Usage

Composer

For the composer, have it like:

composer require myaaghubi/mhm-json-db

Code

    $db = new MHMJsonDB('mydb.json', $pathToDB);

    // select all: array of arrays or an empty array
    var_dump($db->select());

    // select multiple: array of arrays or an empty array
    // sort: $db->select(['name' => 'Moham'], 'name', true);
    var_dump($db->select(['name' => 'Moham']));

    // select one item/array or null
    $result = $db->selectOne(['name' => 'Moham']);

    // returns the whole record as an array
    $insertedRecord = $db->insert(['name' => 'Moham', 'email' => '...']);

    // returns true or false
    $insertedRecord = $db->update(['name' => 'Moham', ...], ['name' => 'Mohammad', ...]);

    // delete multiple: returns the number of deleted
    $deleted = $db->delete(['id' => $insertedRecord['id']]);

    // delete all
    $deleted = $db->delete();

Test

Just run ./vendor/bin/phpunit

License

This project is licensed under an AGPL-3.0 license.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: agpl-3.0
  • 更新时间: 2025-08-22