PHPackages                             phuxtil/chmod - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. phuxtil/chmod

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

phuxtil/chmod
=============

Library to validate symbolic and octal modes used by unix chmod program

3.0.0(5y ago)315.4k1[1 PRs](https://github.com/oliwierptak/phuxtil-chmod/pulls)1MITPHPPHP ^8CI failing

Since Jun 16Pushed 5mo agoCompare

[ Source](https://github.com/oliwierptak/phuxtil-chmod)[ Packagist](https://packagist.org/packages/phuxtil/chmod)[ RSS](/packages/phuxtil-chmod/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (6)Used By (1)

phuxtil-chmod
=============

[](#phuxtil-chmod)

Easy way to validate symbolic and octal modes used by unix `chmod` program.

> In Unix and Unix-like operating systems, chmod is the command and system call which is used to change the access permissions of file system objects. It is also used to change special mode flags.

### Installation

[](#installation)

```
composer require phuxtil/chmod

```

*Note*: Use v1.x for compatibility with PHP v7.0+ *Note*: Use v2.x for compatibility with PHP v7.2+

### Usage

[](#usage)

#### Facade

[](#facade)

Create new instance:

```
$facade = new ChmodFacade();
```

##### isReadable(...)

[](#isreadable)

```
$facade->isReadable('0755');     # true
$facade->isReadable('0334');     # true
$facade->isReadable('0333');     # false
```

##### isWritable(...)

[](#iswritable)

```
$facade->isWritable('0644');     # true
$facade->isWritable('0222');     # true
$facade->isWritable('0111');     # false
```

##### isExecutable(...)

[](#isexecutable)

```
$facade->isExecutable('0755');     # true
$facade->isExecutable('0644');     # false
$facade->isExecutable('0222');     # false
```

##### validateByOctal(...)

[](#validatebyoctal)

```
$facade->validateByOctal('0755', 'u', 'r');     # true
$facade->validateByOctal('0755', 'u', 'x');     # true
$facade->validateByOctal('0755', 'o', 'w');     # false
```

##### validateBySymbol(...)

[](#validatebysymbol)

```
$facade->validateBySymbol('-rw-r--r--', 'u', 'r');     # true
$facade->validateBySymbol('-rw-r--r--', 'u', 'x');     # false
$facade->validateBySymbol('-rw-r--r--', 'o', 'r');     # true
```

##### applyUid(...)

[](#applyuid)

```
$facade->applyUid('0644');          # 4644
```

##### applyGid(...)

[](#applygid)

```
$facade->applyGid('0644');          # 2644
```

##### applyUidAndGid(...)

[](#applyuidandgid)

```
$facade->applyUidAndGid('0644');    # 6644
```

##### toArray()

[](#toarray)

```
print_r($facade->toArray('0775'));
```

```
[
    'u' => [
        'r' => 'r',
        'w' => 'w',
        'x' => 'x',
    ],
    'g' => [
        'r' => 'r',
        'w' => 'w',
        'x' => 'x',
    ],
    'o' => [
        'r' => 'r',
        'w' => '-',
        'x' => 'x',
    ]
]
```

See [`tests`](https://github.com/oliwierptak/phuxtil-chmod/blob/master/tests/Functional/Chmod/ChmodFacadeTest.php) for details.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance49

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~351 days

Total

3

Last Release

1872d ago

Major Versions

1.0.0 → 2.0.02020-02-05

2.0.0 → 3.0.02021-05-18

PHP version history (3 changes)1.0.0PHP ^7

2.0.0PHP ^7.2

3.0.0PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/73a4cc056d2b09189dda46d01b76e71161dd9b75a226230bed6bec8f414d1cf8?d=identicon)[oliwierptak](/maintainers/oliwierptak)

---

Top Contributors

[![oliwierptak](https://avatars.githubusercontent.com/u/495101?v=4)](https://github.com/oliwierptak "oliwierptak (12 commits)")

---

Tags

chmodoctalpermissionsphpsymbolicunix

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phuxtil-chmod/health.svg)

```
[![Health](https://phpackages.com/badges/phuxtil-chmod/health.svg)](https://phpackages.com/packages/phuxtil-chmod)
```

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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