PHPackages                             sweetrdf/iri - 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. sweetrdf/iri

ActiveLibrary

sweetrdf/iri
============

IRI handling for PHP

1.2.1(1mo ago)052MITPHPPHP &gt;=8.1.0CI passing

Since Mar 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/sweetrdf/IRI)[ Packagist](https://packagist.org/packages/sweetrdf/iri)[ Docs](http://www.markus-lanthaler.com)[ RSS](/packages/sweetrdf-iri/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (2)

IRI (Fork)
==========

[](#iri-fork)

Note

**This is a fork of the [Original IRI](https://github.com/lanthaler/IRI)** class written by [Markus Lanthaler](https://github.com/lanthaler). I maintain it in my spare time to keep it alive and usable on the latest PHP versions. Code is more or less maintained but not developed any further. If you wanna participate, feel free to open a pull request!

This is a simple PHP class to ease IRI handling. Currently it just supports parsing of IRIs and relative IRI resolution.

With more than **800 tests**, this class is extensively tested.

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

[](#installation)

The easiest way to use IRI is to integrate it as a dependency in your project's [composer.json](http://getcomposer.org/doc/00-intro.md) file:

```
{
    "require": {
        "sweetrdf/iri": "^1"
    }
}
```

or run:

> composer install sweetrdf/iri

Of course you can also just download an [archive](https://github.com/lanthaler/IRI/downloads) from Github.

### Compatible with original ml/iri

[](#compatible-with-original-mliri)

This library is intented to be a drop-in replacement for the original `ml/iri` library. However, the `IRI` class was adapted to be more type safe:

- Added `declare(strict_types=1);` to the file
- Added explicit type information to each class property
- Added explicit return value types to each class method

❗ `IRI` does not throw an `InvalidArgumentException` anymore if an invalid value was given in the constructor! In this case PHP itself will complain.

Credits
-------

[](#credits)

Most test cases come either directly from the [URI specification](http://tools.ietf.org/html/rfc3986), from [Graham Klyne's](http://www.ninebynine.org/Software/HaskellUtils/Network/URITestDescriptions.html), or [Tim Berners-Lee's](http://dig.csail.mit.edu/2005/ajar/ajaw/test/uri-test-doc.html) test suite.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.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

54d ago

### Community

Maintainers

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

---

Top Contributors

[![lanthaler](https://avatars.githubusercontent.com/u/456407?v=4)](https://github.com/lanthaler "lanthaler (32 commits)")[![k00ni](https://avatars.githubusercontent.com/u/381727?v=4)](https://github.com/k00ni "k00ni (12 commits)")[![jneubert](https://avatars.githubusercontent.com/u/2128921?v=4)](https://github.com/jneubert "jneubert (1 commits)")[![rp-eric](https://avatars.githubusercontent.com/u/9381672?v=4)](https://github.com/rp-eric "rp-eric (1 commits)")[![whikloj](https://avatars.githubusercontent.com/u/2857697?v=4)](https://github.com/whikloj "whikloj (1 commits)")

---

Tags

urluriURNiri

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sweetrdf-iri/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[symfony/routing

Maps an HTTP request to a set of configuration variables

7.6k789.4M1.8k](/packages/symfony-routing)[league/uri

URI manipulation library

1.1k206.4M277](/packages/league-uri)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[ml/iri

IRI handling for PHP

276.4M6](/packages/ml-iri)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)

PHPackages © 2026

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