PHPackages                             efureev/dsn - 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. efureev/dsn

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

efureev/dsn
===========

DSN Parser

v1.0.1(1y ago)02.0kMITPHPPHP ^8.2|^8.3|^8.4

Since Sep 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/efureev/php-dsn)[ Packagist](https://packagist.org/packages/efureev/dsn)[ RSS](/packages/efureev-dsn/feed)WikiDiscussions main Synced 1mo ago

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

DSN Parser
==========

[](#dsn-parser)

[![PHP Package](https://github.com/efureev/php-dsn/actions/workflows/php.yml/badge.svg)](https://github.com/efureev/php-dsn/actions/workflows/php.yml)[![Latest Stable Version](https://camo.githubusercontent.com/b9d9db4ec550cc1de9d672b519be1a7b854b6b1f688b1f59fd8827acb5167018/68747470733a2f2f706f7365722e707567782e6f72672f656675726565762f64736e2f76)](https://packagist.org/packages/efureev/dsn)[![Total Downloads](https://camo.githubusercontent.com/a724d5a0ae2ea0d1fb7af60d2a065f70f2967b5e94b088d7f1d898e05c1c98c9/68747470733a2f2f706f7365722e707567782e6f72672f656675726565762f64736e2f646f776e6c6f616473)](https://packagist.org/packages/efureev/dsn)[![Latest Unstable Version](https://camo.githubusercontent.com/84a410aaa6f5d6b1bbc246535d5754f8c22f30557a48f0145b503f638b2ad3c5/68747470733a2f2f706f7365722e707567782e6f72672f656675726565762f64736e2f762f756e737461626c65)](https://packagist.org/packages/efureev/dsn)[![License](https://camo.githubusercontent.com/dbc3d484e9087f46f241351f1f90c5d986f01b52672d189acf592bfd6ffa1f58/68747470733a2f2f706f7365722e707567782e6f72672f656675726565762f64736e2f6c6963656e7365)](https://packagist.org/packages/efureev/dsn)[![PHP Version Require](https://camo.githubusercontent.com/0a803025f24afbb3371aeea5af3789b14324f2ab43cc925e51ed766f7dc80782/68747470733a2f2f706f7365722e707567782e6f72672f656675726565762f64736e2f726571756972652f706870)](https://packagist.org/packages/efureev/dsn)[![Dependents](https://camo.githubusercontent.com/8ce27f5320f518d6a935e189eb99207d68a7832bc86860d8c078257c7cb58d5b/68747470733a2f2f706f7365722e707567782e6f72672f656675726565762f64736e2f646570656e64656e7473)](https://packagist.org/packages/efureev/dsn)

Description
-----------

[](#description)

There is no official DSN RFC. We have defined a DSN configuration string as using the following definition. The "URL looking" parts of a DSN is based from [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).

Kinds
-----

[](#kinds)

### String DSN

[](#string-dsn)

Template: `://:@:/`

- `http://localhost`
- `localhost:8080`
- `https://examlple.com`
- `examlple.com`
- `http://127.0.0.1/foo/bar?key=value`
- `memcached://127.0.0.1`
- `memcached:///var/local/run/memcached.socket?weight=25`
- `mysql://john:pass@localhost:3306/my_db`
- `scheme:///var/local/run/memcached.socket?weight=25`

### Parameters DSN

[](#parameters-dsn)

Template: `:host=;port=;dbname=`

- `mysql:host=localhost;dbname=example`
- `ocdb://?Driver=ODBC+Driver+13+for+SQL+Server&server=localhost&database=WideWorldImporters&trusted_connection=Yes`

Install
-------

[](#install)

For php &gt;= 8.2

```
composer require efureev/dsn "^1.0"
```

Test
----

[](#test)

```
composer test
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

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 ~0 days

Total

2

Last Release

600d ago

### Community

Maintainers

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

---

Top Contributors

[![efureev](https://avatars.githubusercontent.com/u/5524684?v=4)](https://github.com/efureev "efureev (1 commits)")

---

Tags

dsndsnparserphpphputilitydsn

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/efureev-dsn/health.svg)

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

###  Alternatives

[bdelespierre/underscore

Underscore.js port in PHP

6943.7k1](/packages/bdelespierre-underscore)

PHPackages © 2026

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