PHPackages                             phpdevsr/path-converter-fork - 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. phpdevsr/path-converter-fork

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

phpdevsr/path-converter-fork
============================

Relative path converter

2.0.0(4w ago)08MITPHPPHP ^8.2CI passing

Since May 11Pushed 4w agoCompare

[ Source](https://github.com/PHPDevsr/path-converter-fork)[ Packagist](https://packagist.org/packages/phpdevsr/path-converter-fork)[ Docs](https://github.com/PHPDevsr/path-converter-fork)[ GitHub Sponsors](https://github.com/ddevsr)[ GitHub Sponsors](https://github.com/matthiasmullie)[ RSS](/packages/phpdevsr-path-converter-fork/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (2)Dependencies (5)Versions (5)Used By (0)

Path converter (Fork)
=====================

[](#path-converter-fork)

[![Build status](https://camo.githubusercontent.com/110d745e30efbbb6026fcdc8ea16cd8cac844180df83b89be0cfd27920f35f4d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f50485044657673722f706174682d636f6e7665727465722d666f726b2f746573742e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/PHPDevsr/path-converter-fork/actions/workflows/test.yml)[![Latest version](https://camo.githubusercontent.com/b53d85a7b852617486eea6fa764fb3bc51a8d4b5f4e286d88bf0cadc2bcccdd2/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70687064657673722f706174682d636f6e7665727465722d666f726b3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpdevsr/path-converter-fork)[![License](https://camo.githubusercontent.com/82fa15eb30a7250ac26ee612523f0c3886836552b845ef89836cdc21dc8b400a/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70687064657673722f706174682d636f6e7665727465722d666f726b3f7374796c653d666c61742d737175617265)](https://github.com/PHPDevsr/path-converter-fork/blob/master/LICENSE)

> **Fork of [matthiasmullie/path-converter](https://github.com/matthiasmullie/path-converter)** — original library by [Matthias Mullie](https://www.mullie.eu).

Usage
-----

[](#usage)

```
use PHPDevsr\PathConverter\Converter;

$from = '/css/imports/icons.css';
$to = '/css/minified.css';

$converter = new Converter($from, $to);
$result = $converter->convert('../../images/icon.jpg');
// $result is now '../images/icon.jpg'
```

Methods
-------

[](#methods)

### \_\_construct($from, $to)

[](#__constructfrom-to)

The object constructor accepts 2 paths: the source path your file(s) is/are currently relative to, and the target path to convert to.

### convert($path): string

[](#convertpath-string)

$path is the relative file, which is currently relative to $from (in constructor). The return value will be the relative path of this same file, but now relative to $to (in constructor)

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

[](#installation)

Simply add a dependency on `phpdevsr/path-converter-fork` to your composer.json file if you use [Composer](https://getcomposer.org/) to manage the dependencies of your project:

```
composer require phpdevsr/path-converter-fork
```

Although it's recommended to use Composer, you can actually include these files anyway you want.

License
-------

[](#license)

PathConverter is [MIT](http://opensource.org/licenses/MIT) licensed.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.1% 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 ~0 days

Total

2

Last Release

29d ago

Major Versions

1.0.0 → 2.0.02026-05-11

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6590ade1ca574822a74973c73fcc4d8dd40cdb4412bf6fce2d1bb09e7969e582?d=identicon)[ddevsr](/maintainers/ddevsr)

---

Top Contributors

[![matthiasmullie](https://avatars.githubusercontent.com/u/312776?v=4)](https://github.com/matthiasmullie "matthiasmullie (39 commits)")[![ddevsr](https://avatars.githubusercontent.com/u/97607754?v=4)](https://github.com/ddevsr "ddevsr (7 commits)")[![remyperona](https://avatars.githubusercontent.com/u/3465180?v=4)](https://github.com/remyperona "remyperona (7 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (6 commits)")

---

Tags

pathconverterrelativepaths

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpdevsr-path-converter-fork/health.svg)

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

###  Alternatives

[matthiasmullie/path-converter

Relative path converter

10231.2M8](/packages/matthiasmullie-path-converter)[league/uri-components

URI components manipulation library

31937.4M87](/packages/league-uri-components)[mark-gerarts/auto-mapper-plus

An AutoMapper for PHP

5623.4M22](/packages/mark-gerarts-auto-mapper-plus)[iamcal/php-emoji

This is a PHP library for dealing with Emoji, allowing you to convert between various native formats and displaying them using HTML.

1.3k528.3k](/packages/iamcal-php-emoji)[ncjoes/office-converter

PHP Wrapper for LibreOffice

2521.3M4](/packages/ncjoes-office-converter)[henck/rtf-to-html

RTF to HTML converter in PHP

109837.5k1](/packages/henck-rtf-to-html)

PHPackages © 2026

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