PHPackages                             horde/url - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. horde/url

ActiveLibrary[HTTP &amp; Networking](/categories/http)

horde/url
=========

URL library

v3.0.0(6d ago)14.1k↑17.5%520LGPL-2.1-onlyPHPPHP ^8.1

Since Aug 27Pushed 5d ago5 watchersCompare

[ Source](https://github.com/horde/Url)[ Packagist](https://packagist.org/packages/horde/url)[ Docs](https://www.horde.org/libraries/Horde_Url)[ RSS](/packages/horde-url/feed)WikiDiscussions FRAMEWORK\_6\_0 Synced yesterday

READMEChangelog (5)Dependencies (4)Versions (19)Used By (20)

Horde\_Url
==========

[](#horde_url)

URL manipulation library for PHP 8.1+ Includes bridge from/to PSR-7 native URI objects and legacy Horde internal URL handling.

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

[](#installation)

```
composer require horde/url
```

Quick Start
-----------

[](#quick-start)

```
use Horde\Url\Url;

// Create URL
$url = new Url('https://example.com/page');

// Add parameters
$url->add(['foo' => 'bar', 'id' => 42]);
// Result: https://example.com/page?foo=bar&amp;id=42

// Set anchor
$url->setAnchor('section');
// Result: https://example.com/page?foo=bar&amp;id=42#section

// Generate HTML link
echo $url->link(['class' => 'button']);
// Output:
```

Features
--------

[](#features)

- **Fluent API** - Chainable methods for clean code
- **PSR-7 Bridge** - Convert between Horde\\Url and PSR-7 UriInterface
- **Array Parameters** - Automatic handling of nested arrays
- **Raw/HTML Modes** - Output for URLs (`&`) or HTML (`&amp;`)
- **Data URLs** - Create and manipulate RFC 2397 data URLs
- **Immutable Copy** - Clone URLs for safe modifications

PSR-7 Interoperability
----------------------

[](#psr-7-interoperability)

```
use Horde\Url\Psr7Bridge;

// Horde Url → PSR-7 Uri
$hordeUrl = new Url('https://api.example.com/users?active=1');
$psr7Uri = Psr7Bridge::toPsr7($hordeUrl);

// PSR-7 Uri → Horde Url
$hordeUrl = Psr7Bridge::fromPsr7($psr7Uri);
```

Documentation
-------------

[](#documentation)

- **Upgrading**: See [doc/UPGRADING.md](doc/UPGRADING.md) for migration guide
- **Homepage**: [https://www.horde.org/libraries/Horde\_Url](https://www.horde.org/libraries/Horde_Url)
- **License**: LGPL-2.1-only

Requirements
------------

[](#requirements)

- PHP 8.1 or later
- horde/exception ^3

Optional Dependencies
---------------------

[](#optional-dependencies)

- `psr/http-message` - For PSR-7 bridge support
- `horde/http` - Provides PSR-7 Uri implementation

Development
-----------

[](#development)

```
# Run tests
composer config minimum-stability dev
composer install
phpunit

# Run with coverage
phpunit --coverage-html coverage/
```

Version 3.0 Changes
-------------------

[](#version-30-changes)

Version 3.0 is a major modernization with breaking changes in the src/ path. See [doc/UPGRADING.md](doc/UPGRADING.md) for details. The lib/ path is a legacy compatibility layer and will be removed in Horde 7.

- Modern PSR-4 namespace: `Horde\Url\Url`
- PHP 8.1+ strict types
- PSR-7 interoperability via `Psr7Bridge`
- Enhanced test coverage

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome at

Support
-------

[](#support)

- **Documentation**: [https://www.horde.org/libraries/Horde\_Url](https://www.horde.org/libraries/Horde_Url)
- **Mailing List**:
- **Issues**:

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance99

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community38

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 60.9% 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 ~335 days

Recently: every ~28 days

Total

15

Last Release

6d ago

Major Versions

2.2.6 → 3.0.0alpha12021-02-24

PHP version history (7 changes)2.2.2PHP &gt;=5.3.0

2.2.3PHP &gt;=5.3.0,&lt;=6.0.0alpha1

2.2.5PHP &gt;=5.3.0,&lt;=8.0.0alpha1

2.2.6PHP ^5.3 || ^7

3.0.0alpha1PHP ^7

v3.0.0alpha4PHP ^7.4 || ^8

v3.0.0alpha7PHP ^8.1

### Community

Maintainers

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

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

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

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

![](https://www.gravatar.com/avatar/816e2b926f25f8cd2939054c7a7173011b4303d690e25ab61bf33cf8c7cf71ae?d=identicon)[tdannhauer](/maintainers/tdannhauer)

---

Top Contributors

[![yunosh](https://avatars.githubusercontent.com/u/379318?v=4)](https://github.com/yunosh "yunosh (134 commits)")[![slusarz](https://avatars.githubusercontent.com/u/381003?v=4)](https://github.com/slusarz "slusarz (35 commits)")[![ralflang](https://avatars.githubusercontent.com/u/646976?v=4)](https://github.com/ralflang "ralflang (32 commits)")[![TDannhauer](https://avatars.githubusercontent.com/u/6716033?v=4)](https://github.com/TDannhauer "TDannhauer (6 commits)")[![wrobel](https://avatars.githubusercontent.com/u/10232?v=4)](https://github.com/wrobel "wrobel (5 commits)")[![mrubinsk](https://avatars.githubusercontent.com/u/66822?v=4)](https://github.com/mrubinsk "mrubinsk (4 commits)")[![amulet1](https://avatars.githubusercontent.com/u/18431541?v=4)](https://github.com/amulet1 "amulet1 (3 commits)")[![thomasjfox](https://avatars.githubusercontent.com/u/1146758?v=4)](https://github.com/thomasjfox "thomasjfox (1 commits)")

---

Tags

psr-7uri

### Embed Badge

![Health badge](/badges/horde-url/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[league/uri

URI manipulation library

1.1k240.0M389](/packages/league-uri)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

539238.7M44](/packages/league-uri-interfaces)[crwlr/url

Swiss Army knife for URLs.

10985.9k5](/packages/crwlr-url)[riimu/kit-urlparser

RFC 3986 compliant url parsing library with PSR-7 Uri component

32566.3k2](/packages/riimu-kit-urlparser)[horde/imap_client

IMAP client library

275.5k18](/packages/horde-imap-client)

PHPackages © 2026

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