behzadsp/php-raid
Composer 安装命令:
composer require behzadsp/php-raid
包简介
RAID (redundant array of disks) calculation utility.
README 文档
README
A general purpose RAID (Redundant Array of Independent Disks) library in PHP.
This library can be used to build objects that represent RAIDs. This is useful if you are wanting to manage and keep track of servers in a datacenter environment or for a home lab as part of a larger project.
The library itself simply allows you to create object representations of a RAID and its underlying drives. It manages the total usable capacity of various RAID types for you, as well as hot spares, and general RAID validation for things like minimum drive count for a specific RAID level.
Currently compatible RAID types are:
- RAID 0
- RAID 1
- RAID 5
- RAID 6
- RAID 10
Usage
To create a RAID object, you should determine which type of RAID you would like to create, and initialize
it with an array of \behzadsp\Raid\Drive objects.
use behzadsp\Raid\Drive; use behzadsp\Raid\RaidTen; use behzadsp\Raid\RaidZero; $drives = [ new Drive('1TB', 'ssd', '61cf6218-f378-4c7b-8b81-c09e84a1a86f'), new Drive('1TB', 'ssd', 'c76bee9a-dce6-433c-acc3-b82947335dd2'), new Drive('1TB', 'ssd', '31125db2-6043-4955-818a-af9d259905eb'), new Drive('1TB', 'ssd', '302db7a1-bb2c-4fb9-a9e1-30636e8f312c'), ]; $raidTen = new RaidTen($drives); echo $raidTen->getCapacity(); // 2199023255552 echo $raidTen->getCapacity(['human' => true]); // 2 TB $raidZero = new RaidZero($drives); echo $raidZero->getCapacity(); // 4398046511104 echo $raidZero->getCapacity(['human' => true]); // 4 TB
This library is most useful if you are doing some kind of inventory management already and are storing drives (SSD, HDD) into some kind of persistent RDBMS and would like to also start keeping persistent state of RAID in that system.
It's also a great jumping off point if you want to do something really cool like automate the configuration of hardware or software RAID in your datacenter/environment.
Documentation
Coming soon. For now see the tests.
Contribution
I welcome it and would appreciate it. Fork the repository and create a feature branch off the 'develop' branch and open a pull request.
behzadsp/php-raid 适用场景与选型建议
behzadsp/php-raid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 64 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 behzadsp/php-raid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 behzadsp/php-raid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 64
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-05