PHPackages                             wikimedia/relpath - 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. wikimedia/relpath

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

wikimedia/relpath
=================

Work with file paths to join or find the relative path

4.1.1(4mo ago)11894.3k—6.9%12MITPHPPHP &gt;=8.1

Since Sep 29Pushed 2mo ago13 watchersCompare

[ Source](https://github.com/wikimedia/RelPath)[ Packagist](https://packagist.org/packages/wikimedia/relpath)[ Docs](https://www.mediawiki.org/wiki/RelPath)[ RSS](/packages/wikimedia-relpath/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (15)Used By (2)

RelPath
=======

[](#relpath)

RelPath is a small PHP library for working with file paths, to join two paths, or find the relative path to a path from the current directory or from an optional start directory.

Here is how you use it:

```
$relPath = \Wikimedia\RelPath::getRelativePath( '/srv/mediawiki/resources/src/startup.js', '/srv/mediawiki' );
// Result: "resources/src/startup.js"

$fullPath = \Wikimedia\RelPath::joinPath( '/srv/mediawiki', 'resources/src/startup.js' );
// Result: "/srv/mediawiki/resources/src/startup.js"

$fullPath = \Wikimedia\RelPath::joinPath( '/srv/mediawiki', '/var/startup/startup.js' );
// Result: "/var/startup/startup.js"
```

The `RelPath::joinPath()` function provided here is analogous to `os.path.join()` in Python, and `path.join()` found in Node.js.

License
-------

[](#license)

MIT

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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

Recently: every ~242 days

Total

14

Last Release

128d ago

Major Versions

1.0.4 → 2.0.02017-07-28

2.1.1 → 3.0.02021-08-03

3.0.0 → 4.0.02023-05-17

PHP version history (5 changes)1.0.0PHP &gt;=5.3.3

2.0.0PHP &gt;=5.5.9

3.0.0PHP &gt;=7.2.9

4.0.0PHP &gt;=7.4.3

4.1.0PHP &gt;=8.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/716c86d71cbf921e7912a505f89d799de398fc0a3af0bd4c8862834b2d642bd7?d=identicon)[wikimedia](/maintainers/wikimedia)

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

---

Top Contributors

[![Krinkle](https://avatars.githubusercontent.com/u/156867?v=4)](https://github.com/Krinkle "Krinkle (22 commits)")[![jdforrester](https://avatars.githubusercontent.com/u/881572?v=4)](https://github.com/jdforrester "jdforrester (12 commits)")[![atdt](https://avatars.githubusercontent.com/u/376462?v=4)](https://github.com/atdt "atdt (11 commits)")[![umherirrender](https://avatars.githubusercontent.com/u/1174884?v=4)](https://github.com/umherirrender "umherirrender (8 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (8 commits)")[![ricordisamoa](https://avatars.githubusercontent.com/u/4588496?v=4)](https://github.com/ricordisamoa "ricordisamoa (4 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (3 commits)")[![anny21](https://avatars.githubusercontent.com/u/34449508?v=4)](https://github.com/anny21 "anny21 (2 commits)")[![Daimona](https://avatars.githubusercontent.com/u/38216014?v=4)](https://github.com/Daimona "Daimona (1 commits)")[![skizzerz](https://avatars.githubusercontent.com/u/72652?v=4)](https://github.com/skizzerz "skizzerz (1 commits)")[![DannyS712](https://avatars.githubusercontent.com/u/46829944?v=4)](https://github.com/DannyS712 "DannyS712 (1 commits)")

---

Tags

normalizefilesystempathfilejoinsystemosfilepath

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wikimedia-relpath/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[riimu/kit-pathjoin

Cross-platform library for normalizing and joining file system paths

12603.0k4](/packages/riimu-kit-pathjoin)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72428.6M91](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

225231.8M39](/packages/league-flysystem-local)

PHPackages © 2026

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