PHPackages                             phuxtil/stat - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. phuxtil/stat

ActiveLibrary[File &amp; Storage](/categories/file-storage)

phuxtil/stat
============

Easy interface for output of 'stat' unix command

3.0.3(3y ago)015.5k2MITPHPPHP ^8CI failing

Since Jun 16Pushed 3y agoCompare

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

READMEChangelog (4)Dependencies (3)Versions (12)Used By (2)

phuxtil-stat
============

[](#phuxtil-stat)

Provides easy way of accessing data generated by `stat` unix command.

> stat is a Unix system call that returns file attributes about an inode.

### Installation

[](#installation)

```
composer require phuxtil/stat

```

### Usage

[](#usage)

###### stat sample output

[](#stat-sample-output)

```
  File: /tmp/foo/bar.txt
  Size: 70        	Blocks: 8          IO Block: 4096   regular file
Device: 57h/87d	Inode: 9920467     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-06-07 18:13:35.000000000 +0000
Modify: 2019-06-07 18:13:35.000000000 +0000
Change: 2019-06-07 18:13:35.000000000 +0000
 Birth: -

```

#### Facade

[](#facade)

```
$stat = (new StatFacade())->process(...);

echo $stat->getBlocks();      # 8
echo $stat->getDateAccess();  # DateTime {date: 2019-06-07 18:13:35.0 +00:00}
echo $stat->getDateModify();  # DateTime {date: 2019-06-07 18:13:35.0 +00:00}
echo $stat->getDateChange();  # DateTime {date: 2019-06-07 18:13:35.0 +00:00}
echo $stat->getDevice();      # 57h/87d
echo $stat->getFilename();    # /tmp/foo/bar.txt
echo $stat->getGid();         # 0
echo $stat->getGroup();       # root
echo $stat->getInode();       # 9920467
echo $stat->getIoBlock();     # 4096
echo $stat->getLinks();       # 1
echo $stat->getPermission();  # 644
echo $stat->getSize();        # 70
echo $stat->getType();        # file
echo $stat->getUid();         # 0
echo $stat->getUser();        # root
```

#### $stat-&gt;toArray()

[](#stat-toarray)

```
print_r($stat->toArray());
```

```
[
  filename: "/tmp/remote_fs/remote.txt"
  size: 70
  type: "file"
  permission: 644
  dateAccess: DateTime @1559931215 {#4840
    date: 2019-06-07 18:13:35.0 +00:00
  }
  dateModify: DateTime @1559931215 {#4857
    date: 2019-06-07 18:13:35.0 +00:00
  }
  dateChange: DateTime @1559931215 {#4858
    date: 2019-06-07 18:13:35.0 +00:00
  }
  uid: 0
  gid: 0
  user: "root"
  group: "root"
  inode: 9920467
  device: "57h/87d"
  links: 1
  blocks: "8"
  ioBlock: 4096
]
```

#### $stat-&gt;fromArray()

[](#stat-fromarray)

```
$stat->fromArray([
    'filename' => '/tmp/foo/bar.txt',
    'size' => 70,
    'type' => 'file',
    ...
]);
```

See [tests](https://github.com/oliwierptak/phuxtil-stat/blob/master/tests/Functional/Stat/StatFacadeTest.php) for details.

### PHP version

[](#php-version)

Use v1.x for compatibility with PHP v7.0.x.

Use v2.x for compatibility with PHP v7.2+.

Use v3.x for compatibility with PHP v8+.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

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 ~203 days

Recently: every ~261 days

Total

8

Last Release

1146d ago

Major Versions

1.0.0 → 2.0.02020-01-20

2.0.2 → 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 (23 commits)")

---

Tags

filefilesystemphpstatunixunix-commandunix-shell

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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