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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sweetrdf/iri

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

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

IRI handling for PHP

1.2.1(4mo ago)06.7k2MITPHPPHP &gt;=8.1.0CI passing

Since Mar 19Pushed 4mo 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 2d 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

42

—

FairBetter than 88% of packages

Maintenance74

Regular maintenance activity

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity44

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

144d 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

[ml/iri

IRI handling for PHP

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

URI components manipulation library

32044.0M106](/packages/league-uri-components)[sabre/uri

Functions for making sense out of URIs.

29638.6M46](/packages/sabre-uri)[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

193583.0k](/packages/cybercog-laravel-optimus)[opis/uri

Build, parse and validate URIs and URI-templates

2128.8M8](/packages/opis-uri)[rowbot/url

A WHATWG URL spec compliant URL parser for working with URLs and their query strings.

19693.7k8](/packages/rowbot-url)

PHPackages © 2026

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