PHPackages                             kusabi/uri - 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. kusabi/uri

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

kusabi/uri
==========

A PSR-7 and PSR-17 conforming uri library for PHP

1.0.4(6y ago)09mitPHPPHP ^7.0CI failing

Since Mar 27Pushed 5y agoCompare

[ Source](https://github.com/kusabi/uri)[ Packagist](https://packagist.org/packages/kusabi/uri)[ RSS](/packages/kusabi-uri/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (1)Dependencies (7)Versions (6)Used By (0)

Uri wrapper
===========

[](#uri-wrapper)

[![Tests](https://github.com/kusabi/uri/workflows/tests/badge.svg)](https://github.com/kusabi/uri/workflows/tests/badge.svg)[![codecov](https://camo.githubusercontent.com/e3971e3fc6af9b70f714410a05f6e4115840a3617138aca6faae74986638a2d9/68747470733a2f2f636f6465636f762e696f2f67682f6b75736162692f7572692f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/kusabi/uri)[![Licence Badge](https://camo.githubusercontent.com/6f73be3fb17646698468f1bb756dfaebcfe122c99ca60f48de64ad3ef6895050/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b75736162692f7572692e737667)](https://img.shields.io/github/license/kusabi/uri.svg)[![Release Badge](https://camo.githubusercontent.com/601d4e170c6b02c89236dc6796cf726a163a5890c782dc9266d96cf7a52696a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b75736162692f7572692e737667)](https://img.shields.io/github/release/kusabi/uri.svg)[![Tag Badge](https://camo.githubusercontent.com/03ee99b0fa4e615f1ac3c8de74a3516137ac319ac0982632304b6c79da8c101d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6b75736162692f7572692e737667)](https://img.shields.io/github/tag/kusabi/uri.svg)[![Issues Badge](https://camo.githubusercontent.com/83f0c8244bf7a72de8ed8d4fb3f32ba07130d1313ea9efd0d916483908aee393/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6b75736162692f7572692e737667)](https://img.shields.io/github/issues/kusabi/uri.svg)[![Code Size](https://camo.githubusercontent.com/83b87d637fcc0f1af078a6c47632b04b759aa12c483d4f52c79dc5c4895da3ba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6b75736162692f7572692e7376673f6c6162656c3d73697a65)](https://img.shields.io/github/languages/code-size/kusabi/uri.svg)

An implementation of a [PSR-7](https://www.php-fig.org/psr/psr-7/) &amp; [PSR-17](https://www.php-fig.org/psr/psr-17/) conforming Uri library

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

[](#installation)

Installation is simple using composer.

```
composer require kusabi/uri
```

Or simply add it to your `composer.json` file

```
{
    "require": {
        "kusabi/uri": "^1.0"
    }
}
```

Using the Uri class
-------------------

[](#using-the-uri-class)

The Uri class is a very basic wrapper around a Uri string.

```
use Kusabi\Uri\Uri;

// Instantiate a Uri instance
$uri = new Uri('https://user:pass@www.my-site.com:8080/users/22?filter=name#bottom');

// Fetch the properties of the Uri instance
echo $uri->getScheme();
echo $uri->getAuthority();
echo $uri->getUserInfo();
echo $uri->getHost();
echo $uri->getPort();
echo $uri->getPath();
echo $uri->getQuery();
echo $uri->getFragment();
```

Using the Uri factory
---------------------

[](#using-the-uri-factory)

The Uri factory can be used to create the Uri instance too.

```
use Kusabi\Uri\UriFactory;

// Instantiate a Uri instance
$factory = new UriFactory();
$uri = $factory->createUri('https://user:pass@www.my-site.com:8080/users/22?filter=name#bottom');

// Fetch the properties of the Uri instance
echo $uri->getScheme();
echo $uri->getAuthority();
echo $uri->getUserInfo();
echo $uri->getHost();
echo $uri->getPort();
echo $uri->getPath();
echo $uri->getQuery();
echo $uri->getFragment();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~27 days

Total

5

Last Release

2500d ago

PHP version history (2 changes)1.0.0PHP ~7.2

1.0.4PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/62f4942978644437b5ff3d7bd3f6411580413d327b001104acd4914f43ab63b6?d=identicon)[kusabi](/maintainers/kusabi)

---

Top Contributors

[![kusabi](https://avatars.githubusercontent.com/u/22000941?v=4)](https://github.com/kusabi "kusabi (2 commits)")

---

Tags

phppsr-17psr-7uriurl

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/kusabi-uri/health.svg)

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

###  Alternatives

[embed/embed

PHP library to retrieve page info using oembed, opengraph, etc

2.1k11.0M97](/packages/embed-embed)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[anthropic-ai/sdk

Anthropic PHP SDK

129134.7k5](/packages/anthropic-ai-sdk)[shopware/app-php-sdk

Shopware App SDK for PHP

1577.8k1](/packages/shopware-app-php-sdk)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

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