PHPackages                             vertilia/filesystem - 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. vertilia/filesystem

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

vertilia/filesystem
===================

Filesystem helpers

v1.0.1(4y ago)0241BSD-2-ClausePHP

Since Nov 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/vertilia/filesystem)[ Packagist](https://packagist.org/packages/vertilia/filesystem)[ RSS](/packages/vertilia-filesystem/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

filesystem
==========

[](#filesystem)

Filesystem helpers implementing useful functionality.

Usage
-----

[](#usage)

- `normalizePath()`

Converts path to its canonical form, removes leading and trailing slashes(/).

```
print_r(Vertilia\Filesystem\Filesystem::normalizePath('//b/../a//b/c/./d//'));
// outputs: 'a/b/c/d'
```

- `syncSymlinkDir()`

Given the external symlink and local symlink, compares symlink targets and if different, copies external folder to local folder and switches local symlink. Handles local symlink TTL, uses lock file to manage race conditions under heavy load in multi-process environments.

The following example describes a folder on a shared ressource with the latest file structure that needs to be mirrored to local filesystems. Every host is responsible for maintaining the local copy of external ressource locally. Current release is identified by the `current` symlink inside the `release` folder.

- on shared ressource

```
/shared/release
├── v1.0.0
│   ├── file1.txt
│   ├── file2.txt
│   └── file3.txt
├── v1.0.1
│   ├── file1.txt
│   ├── file2.txt
│   └── file3.txt
├── v1.0.2
│   ├── file1.txt
│   ├── file2.txt
│   └── file3.txt
└── current -> v1.0.2

```

- on every host

```
/local/release
├── v1.0.0
│   ├── file1.txt
│   ├── file2.txt
│   └── file3.txt
├── v1.0.1
│   ├── file1.txt
│   ├── file2.txt
│   └── file3.txt
└── current -> v1.0.1

```

The following snippet executed on each host will verify the freshness of `current` symlink in `/local/release`folder and if it is older than 600 seconds, will

- try to create a lock file or exit

    - if lockfile exists but is older than 60 seconds, delete the file before exiting
- verify target of `current` symlink in both `/local/release` and `/shared/release`
- if targets point to the same release:

    - touch local `current` symlink
    - delete lock file
    - exit
- else:

    - copy the contents of `/shared/release/v1.0.2` to `/local/release/v1.0.2`
    - switch `/local/release/current` symlink to point to `v1.0.2`
    - delete lock file
    - exit

Snippet:

```
try {
    Vertilia\Filesystem\Filesystem::syncSymlinkDir(
        '/shared/release/current',
        '/local/release/current',
        600,
        60
    );
} catch (RuntimeException $e) {
    $logger->log($e->getMessage());
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Total

3

Last Release

1641d ago

Major Versions

v0.1.0 → v1.0.02021-11-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6480642?v=4)[Stas Trefilov](/maintainers/dotgit)[@dotgit](https://github.com/dotgit)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vertilia-filesystem/health.svg)

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

###  Alternatives

[craftcms/rector

Rector sets to automate Craft CMS upgrades

17232.9k257](/packages/craftcms-rector)[andrefigueira/blog-article-faker

Generate random blog article titles and content (including markdown) using faker

1415.0k](/packages/andrefigueira-blog-article-faker)

PHPackages © 2026

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