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

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

jbzoo/path
==========

PHP virtual path library

7.0.2(7mo ago)1194.7k16MITPHPPHP ^8.2CI passing

Since Jan 18Pushed 7mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (24)Used By (6)

JBZoo / Path
============

[](#jbzoo--path)

[![CI](https://github.com/JBZoo/Path/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Path/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://camo.githubusercontent.com/5af69768d36cfddc2bc1315951a4f3ed3e43a6129b1db5fb2212f69e73004d16/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a425a6f6f2f506174682f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/JBZoo/Path?branch=master) [![Psalm Coverage](https://camo.githubusercontent.com/7b0162b80e94d9a21eb8ee045c85eff8f57c3b9eca8958e808a8780e9d6248e5/68747470733a2f2f73686570686572642e6465762f6769746875622f4a425a6f6f2f506174682f636f7665726167652e737667)](https://shepherd.dev/github/JBZoo/Path) [![Psalm Level](https://camo.githubusercontent.com/1ce0887befa3ff21f563c8276127d73e87d2602d8562ead9134c89698971ce6d/68747470733a2f2f73686570686572642e6465762f6769746875622f4a425a6f6f2f506174682f6c6576656c2e737667)](https://shepherd.dev/github/JBZoo/Path) [![CodeFactor](https://camo.githubusercontent.com/f42a1f54fcabd24dbe21d4fd489f6c810ed58587dd55fe5ce2f5af11fa7a4ac4/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6a627a6f6f2f706174682f6261646765)](https://www.codefactor.io/repository/github/jbzoo/path/issues)[![Stable Version](https://camo.githubusercontent.com/85aa1a9113de5142153e4595cbac6652eda583df797a3da7d2c31b4c46d56249/68747470733a2f2f706f7365722e707567782e6f72672f6a627a6f6f2f706174682f76657273696f6e)](https://packagist.org/packages/jbzoo/path/) [![Total Downloads](https://camo.githubusercontent.com/56d2f13aa6b48e374a5eb794dcaf1a00417a340dac07adf66b47c976c2fcd4d7/68747470733a2f2f706f7365722e707567782e6f72672f6a627a6f6f2f706174682f646f776e6c6f616473)](https://packagist.org/packages/jbzoo/path/stats) [![Dependents](https://camo.githubusercontent.com/588055dfb546a385e39a153dd96730a7f121035fcb6611e980b6160291da308d/68747470733a2f2f706f7365722e707567782e6f72672f6a627a6f6f2f706174682f646570656e64656e7473)](https://packagist.org/packages/jbzoo/path/dependents?order_by=downloads) [![GitHub License](https://camo.githubusercontent.com/4e269781e5ac6e0fa0a85d1568f529cae5f43a4d927961b8b055080b6897743f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a627a6f6f2f70617468)](https://github.com/JBZoo/Path/blob/master/LICENSE)

A PHP library for creating memory-based aliases for your project file system. This virtual path system allows you to map logical names to physical directories, making file access and URL generation much easier and more maintainable.

Features
--------

[](#features)

- 🚀 **Virtual Path Mapping**: Create logical aliases for filesystem paths
- 🔗 **URL Generation**: Automatically generate URLs from file paths
- 📁 **Multiple Path Support**: Add multiple directories under the same alias
- 🔍 **File Resolution**: Find files across multiple registered paths
- 🧹 **Path Normalization**: Clean and normalize file paths
- ⚡ **Performance Optimized**: Faster than native PHP realpath() in many scenarios

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

[](#requirements)

- PHP 8.2 or higher
- Composer for installation

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

[](#installation)

```
composer require jbzoo/path
```

Quick Start
-----------

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
