PHPackages                             phpactor/file-path-resolver - 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. phpactor/file-path-resolver

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

phpactor/file-path-resolver
===========================

Resolve files paths for your application (e.g. cache, data, etc)

0.8.3(5y ago)056.2k↑80%1MITPHPPHP ^7.3 || ^8.0

Since Oct 30Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (9)Versions (13)Used By (1)

File Path Resolver
==================

[](#file-path-resolver)

[![CI](https://github.com/phpactor/file-path-resolver/workflows/CI/badge.svg)](https://github.com/phpactor/file-path-resolver/workflows/CI/badge.svg)

Resolves file paths by filtering and replacing tokens with values.

- Canonicalization support via `webmozart/path-util`
- XDG directory expansion via `dnoegel/php-xdg-base-dir`

This package can be used in, for example, a CLI application such as [Phpactor](https://github.com/phpactor/phpactor') to resolve application paths.

Usage
-----

[](#usage)

```
$pathResolver = new PathResolver([
    new CanonicalizationFilter(),
    new TokenExpandingFilter([
        new ValueExpander('%my_token%', 'my_value'),
        new XdgCacheExpander('%xdg_cache%'),
        new XdgConfigExpander('%xdg_conifg%'),
        new CallbackExpander('%callback%', function () {
            return 'hello from callback';
        });
    ])
]);

$pathResolver->resolve('/foo/../foo/%my_token%'); // foo/my_value
$pathResolver->resolve('%xdg_home%/my_app'); // /home/user/.config/my_app
$pathResolver->resolve('%callback%'); // hello from callback
```

Contributing
------------

[](#contributing)

This package is open source and welcomes contributions! Feel free to open a pull request on this repository.

Support
-------

[](#support)

- Create an issue on the main [Phpactor](https://github.com/phpactor/phpactor) repository.
- Join the `#phpactor` channel on the Slack [Symfony Devs](https://symfony.com/slack-invite) channel.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.8% 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 ~83 days

Recently: every ~191 days

Total

11

Last Release

1927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24ec7d5d6b7ea54007be5d7b4f43800381cc1e22929f7d2276fba30e497fdfa6?d=identicon)[dantleech](/maintainers/dantleech)

---

Top Contributors

[![dantleech](https://avatars.githubusercontent.com/u/530801?v=4)](https://github.com/dantleech "dantleech (44 commits)")[![dktapps](https://avatars.githubusercontent.com/u/14214667?v=4)](https://github.com/dktapps "dktapps (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpactor-file-path-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/phpactor-file-path-resolver/health.svg)](https://phpackages.com/packages/phpactor-file-path-resolver)
```

###  Alternatives

[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.8k15.7k](/packages/phpactor-phpactor)[dantleech/fink

Checks Links

2266.3k2](/packages/dantleech-fink)[grasmash/composerize-drupal

Convert a non-Composer managed Drupal application into a Composer-managed application.

12819.4k1](/packages/grasmash-composerize-drupal)[puli/manager

Manages the puli.json file of a Puli project.

6847.9k3](/packages/puli-manager)[chenos/v8js-module-loader

1629.5k1](/packages/chenos-v8js-module-loader)

PHPackages © 2026

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