PHPackages                             deepeloper/lib-fs - 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. deepeloper/lib-fs

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

deepeloper/lib-fs
=================

File system library

3.0.0(2y ago)224MITPHPPHP &gt;=8.1

Since Jun 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/deepeloper/lib-fs)[ Packagist](https://packagist.org/packages/deepeloper/lib-fs)[ Docs](https://github.com/deepeloper/lib-fs)[ RSS](/packages/deepeloper-lib-fs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (9)Used By (0)

File system library
===================

[](#file-system-library)

[![Packagist version](https://camo.githubusercontent.com/fed9e636289758ac535a98e66dabec09de208123efc4ebfe3f8bf1bac7a97646/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656570656c6f7065722f6c69622d6673)](https://packagist.org/packages/deepeloper/lib-fs)[![PHP from Packagist](https://camo.githubusercontent.com/30b5ee9a05ce49bdb144bebf0c50cf9e0722c23b1b4527c734f00a4d7b46a21c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64656570656c6f7065722f6c69622d66732e737667)](http://php.net/)[![GitHub license](https://camo.githubusercontent.com/5f535ed6037ec8427726e2b34927afbf084da4c2a1761fa16d710979804b6ccc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64656570656c6f7065722f6c69622d66732e737667)](https://github.com/deepeloper/lib-fs/blob/master/LICENSE)[![GitHub issues](https://camo.githubusercontent.com/f89c38d12a13a17f72c6d6501959294eb412f49ac02e80e15df3f4125561b244/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f64656570656c6f7065722f6c69622d66732e737667)](https://github.com/deepeloper/lib-fs/issues)[![Packagist](https://camo.githubusercontent.com/3fb07464a3702c578dcde0ed5e24247cf0260f93a8b248ae54c7c933d213198e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656570656c6f7065722f6c69622d66732e737667)](https://packagist.org/packages/deepeloper/lib-fs)

[![Donation](https://camo.githubusercontent.com/a59a69ad3d5f2b3205fc267af930d371787bc02ca5a4369f1d2556b119b28f16/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174696f6e2d566973612c2532304d6173746572436172642c2532304d61657374726f2c253230556e696f6e5061792c253230596f6f4d6f6e65792c2532302544302539432544302539382544302541302d726564)](https://yoomoney.ru/to/41001351141494)

Installation
------------

[](#installation)

Run `composer require deepeloper/lib-fs`.

Usage
-----

[](#usage)

### Tools: walking directory recursively

[](#tools-walking-directory-recursively)

```
\deepeloper\Lib\FileSystem\Tools::walkDir(
    "/path/to/dir",
    function (\SplFileInfo $file, $key, array $args) {
        // $args["path"] contains passed "/path/to/dir" ($path)
        echo sprintf(
            "[%s] %s%s", $file->isDir() ? "DIR " : "file",
            $file->getRealPath(),
            PHP_EOL
        );
    }
);
```

### Tools: removing directory recursively

[](#tools-removing-directory-recursively)

```
\deepeloper\Lib\FileSystem\Tools::removeDir("/path/to/dir");
// clearstatcache(...);
```

### Tools: searching &amp; replacing recursively

[](#tools-searching--replacing-recursively)

```
\deepeloper\Lib\FileSystem\Tools::search(
    "/path/to/dir",
    0,           // Flags (php://glob())
    ["*", ".*"], // File name patterns (php://glob())
    ["*", ".*"], // Subdir name patterns (php://glob())
    "needle",    // String to search in files, if starts with "/" processes like regular expression
    function ($path, array $args)
    {
        // $args['path'] contains passed "/path/to/dir" ($dir)
        // $args['needle'] contains passed "needle" ($needle)
        $contents = file_get_contents($path);
        $contents = preg_replace("/needle/", "replacement", $contents);
        file_put_contents($path, $contents);
    }
);
```

### Logging functionality supporting files rotation

[](#logging-functionality-supporting-files-rotation)

```
$logger = new \deepeloper\Lib\FileSystem\Logger([
    'path'    => "/path/to/log",
    // 'maxSize' => int maxSize,   // Logger::DEFAULT_MAX_SIZE by default.
    // 'rotation' => int rotation, // Rotating files number, 0 means no rotation.
    // 'rights'    => int rights,  // If set after writing to log file chmod() will be called.
]);
$logger->log("Foo");
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.7% 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 ~0 days

Total

7

Last Release

1057d ago

Major Versions

1.1.0 → 2.0.02023-06-22

2.3.0 → 3.0.02023-06-22

PHP version history (7 changes)1.0.0PHP &gt;=5.4 &lt;5.6

1.1.0PHP ^5.6

2.0.0PHP ^7.0

2.1.0PHP &gt;=7.2.5 &lt;7.3

2.2.0PHP &gt;=7.3 &lt;7.4

2.3.0PHP &gt;=7.4

3.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b08c1bee93473eb7b0d4f736249f68bf5c6319715ea036dbfd7532db9a0a7ecc?d=identicon)[deepeloper](/maintainers/deepeloper)

---

Top Contributors

[![donbidon](https://avatars.githubusercontent.com/u/30872013?v=4)](https://github.com/donbidon "donbidon (18 commits)")[![deepeloper](https://avatars.githubusercontent.com/u/1831371?v=4)](https://github.com/deepeloper "deepeloper (1 commits)")

---

Tags

phplibraryfilesystemfs

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/deepeloper-lib-fs/health.svg)

```
[![Health](https://phpackages.com/badges/deepeloper-lib-fs/health.svg)](https://phpackages.com/packages/deepeloper-lib-fs)
```

###  Alternatives

[adlawson/vfs

Virtual file system

300433.0k21](/packages/adlawson-vfs)[blueimp/jquery-file-upload

File Upload widget for jQuery.

141.5M18](/packages/blueimp-jquery-file-upload)

PHPackages © 2026

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