PHPackages                             behzadsp/php-raid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. behzadsp/php-raid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

behzadsp/php-raid
=================

RAID (redundant array of disks) calculation utility.

v2.0.1(3y ago)064MITPHPPHP &gt;= 7.0

Since Oct 4Pushed 3y agoCompare

[ Source](https://github.com/behzadsp/php-raid)[ Packagist](https://packagist.org/packages/behzadsp/php-raid)[ Docs](https://github.com/behzadsp/php-raid)[ RSS](/packages/behzadsp-php-raid/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

php-raid
========

[](#php-raid)

###### A general purpose RAID (Redundant Array of Independent Disks) library in PHP.

[](#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
-----

[](#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
-------------

[](#documentation)

Coming soon. For now see the [tests](/tests).

Contribution
------------

[](#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.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~795 days

Total

3

Last Release

1192d ago

Major Versions

v1.0.0 → v2.0.02023-02-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c976f887d8887e63954318fc142b6820ed715f5b01bdc53d4f0ab350a9d6814?d=identicon)[behzadsp](/maintainers/behzadsp)

---

Top Contributors

[![kevinquinnyo](https://avatars.githubusercontent.com/u/593681?v=4)](https://github.com/kevinquinnyo "kevinquinnyo (92 commits)")[![sdustinh](https://avatars.githubusercontent.com/u/2855100?v=4)](https://github.com/sdustinh "sdustinh (10 commits)")[![behzadsp](https://avatars.githubusercontent.com/u/58994682?v=4)](https://github.com/behzadsp "behzadsp (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/behzadsp-php-raid/health.svg)

```
[![Health](https://phpackages.com/badges/behzadsp-php-raid/health.svg)](https://phpackages.com/packages/behzadsp-php-raid)
```

###  Alternatives

[verbb/icon-picker

A slick field to pick icons from. Supports SVGs, Sprites, Webfonts, Font Awesome and more.

16162.4k4](/packages/verbb-icon-picker)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20269.1k13](/packages/shopsys-coding-standards)[flyeralarm/php-code-validator

A custom coding standard for FLYERALARM

2226.9k6](/packages/flyeralarm-php-code-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
