PHPackages                             phpdot/path - 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. phpdot/path

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

phpdot/path
===========

Project-root discovery and named path resolution for PHPdot, configured via phpdot/config.

v0.2.0(2w ago)01MITPHPPHP &gt;=8.5

Since Jul 18Pushed 2w agoCompare

[ Source](https://github.com/phpdot/path)[ Packagist](https://packagist.org/packages/phpdot/path)[ RSS](/packages/phpdot-path/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (15)Versions (3)Used By (0)

phpdot/path
===========

[](#phpdotpath)

Project-root discovery and named path resolution for PHPdot. Paths are declared in `config/path.php`, resolved to absolute paths at runtime, and reached through the `PathRegistryInterface` contract. The project root is written in at install time (or auto-detected from Composer), and unmapped names throw rather than being guessed.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Architecture](#architecture)
- [Testing](#testing)
- [License](#license)

Requirements
------------

[](#requirements)

RequirementConstraintPHP`>= 8.5``composer-runtime-api``^2.2``phpdot/config``^0.2``phpdot/package``^0.2``phpdot/container` is a dev-only suggestion — the `#[Config('path')]` / binding attributes are inert until a phpdot application reflects them.

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

[](#installation)

```
composer require phpdot/path
```

Usage
-----

[](#usage)

`PathRegistry` is a container singleton bound to `PathRegistryInterface` — inject the contract and read absolute paths by their name:

```
use PHPdot\Path\Contract\PathRegistryInterface;

$path = $container->get(PathRegistryInterface::class);

$path->base();          // /var/www/app
$path->config();        // /var/www/app/config
$path->vendor();        // /var/www/app/vendor
$path->public();        // /var/www/app/public
$path->protected();     // /var/www/app/protected
$path->get('uploads');  // /var/www/app/storage/uploads
$path->has('uploads');  // true
```

Every returned path is absolute. An unmapped name throws `PathNotMapped` — paths are explicit, never guessed.

Architecture
------------

[](#architecture)

At install time `phpdot/package` scaffolds `config/path.php` and the `PathInstaller` install hook writes the absolute project root into `base`. At runtime `ProjectRoot` resolves the base (auto-detecting from Composer when `base` is empty) and `PathRegistry` resolves every named path to an absolute path.

 ```
graph TD
    CONFIG["config/path.phpbase + named paths (PathsConfig defaults)"]
    INSTALL["PathInstaller  #[InstallHook]writes the absolute project root into base"]
    ROOT["ProjectRootbase, or auto-detected from Composer when empty"]
    REGISTRY["PathRegistry → PathRegistryInterfaceresolves every name to an absolute path"]

    INSTALL --> CONFIG
    CONFIG --> ROOT
    ROOT --> REGISTRY
```

      Loading Testing
-------

[](#testing)

```
composer install
composer test        # PHPUnit
composer analyse     # PHPStan, level max + strict rules
composer cs-check    # PHP-CS-Fixer
composer check       # All three
```

License
-------

[](#license)

MIT.

**This repository is a read-only mirror**, generated by CI from [phpdot/monorepo](https://github.com/phpdot/monorepo). [Pull requests](https://github.com/phpdot/monorepo/pulls)and [issues](https://github.com/phpdot/monorepo/issues) belong in the monorepo.

###  Health Score

38

—

LowBetter than 82% of packages

Maintenance97

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Total

2

Last Release

14d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62e82421bda4b5d6ba9a47ba6d88caca060dcd0d1a2862f351f3a97657385db0?d=identicon)[phpdot](/maintainers/phpdot)

---

Top Contributors

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

---

Tags

filesystemconfigpathproject rootphpdot

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpdot-path/health.svg)

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.7M2.3k](/packages/symfony-symfony)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k263.2M12.8k](/packages/symfony-framework-bundle)[symfony/web-profiler-bundle

Provides a development tool that gives detailed information about the execution of any request

2.3k167.9M1.5k](/packages/symfony-web-profiler-bundle)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86538.6k](/packages/flow-php-flow)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

203582.5k3](/packages/wikimedia-parsoid)[wikimedia/relpath

Work with file paths to join or find the relative path

13964.6k4](/packages/wikimedia-relpath)

PHPackages © 2026

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