承接 mirzaev/baza 相关项目开发

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

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

mirzaev/baza

最新稳定版本:3.4.1

Composer 安装命令:

composer require mirzaev/baza

包简介

Lightweight binary database by pure PHP

README 文档

README

Lightweight binary database by pure PHP

Dependencies

  1. PHP 8.4
  2. Composer (php package manager)

Installation

composer require mirzaev/baza

Example

<?php

use mirzaev\baza\database,
    mirzaev\baza\column,
    mirzaev\baza\record,
    mirzaev\baza\enumerations\encoding,
    mirzaev\baza\enumerations\type;

// Initializing the database
$database = new database()
    ->encoding(encoding::utf8)
    ->columns(
        new column('name', type::string, ['length' => 32]),
        new column('second_name', type::string, ['length' => 64]),
        new column('age', type::integer),
        new column('height', type::float)
    )
    ->connect(__DIR__ . DIRECTORY_SEPARATOR . 'database.ba');

// Initializing the record
$record = $database->record(
    'Arsen',
    'Mirzaev',
    23,
    (float) 165
);

if ($database->write($record)) {
    // Writed the record into the database

    // Updating the record in the database
    $updated = $database->read(
        filter: fn($record) => $record->name === 'Arsen', 
        update: fn(&$record) => $record->age = 24, 
        amount: 1
    );

    // Reading the record from the database
    $readed = $database->read(
        filter: fn($record) => $record->name === 'Arsen' && $record->age === 24,
        amount: 1
    );

    // Deleting the record from the database
    $deleted = $database->read(
        filter: fn($record) => $record->age < 25,
        delete: true,
        amount: 1000
    );
}
?>

Used by

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2025-01-28