https://github.com/ixnode/php-dsn-parser
PHP DSN parser - This library helps to parse DSN\URI strings.
https://github.com/ixnode/php-dsn-parser
Last synced: 8 months ago
JSON representation
PHP DSN parser - This library helps to parse DSN\URI strings.
- Host: GitHub
- URL: https://github.com/ixnode/php-dsn-parser
- Owner: ixnode
- License: mit
- Created: 2023-09-16T11:54:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-16T12:24:41.000Z (almost 3 years ago)
- Last Synced: 2024-12-27T01:41:39.467Z (over 1 year ago)
- Language: Shell
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP DSN Parser
[](https://github.com/ixnode/php-dsn-parser/releases)
[](https://github.com/ixnode/php-dsn-parser/releases)

[](https://www.php.net/supported-versions.php)
[](https://phpstan.org/user-guide/rule-levels)
[](https://phpunit.de)
[](https://www.php-fig.org/psr/psr-12/)
[](https://github.com/phpmd/phpmd)
[](https://github.com/rectorphp/rector)
[](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)
> This library helps to parse DSN\URI strings.
## 1. Usage
```php
use Ixnode\PhpDsnParser\DsnParser;
```
```php
$dsnParser = new DsnParser('smtp://suserweb:S22jD7Po%.,/zu34k@mail.domain.tld:25?verify_peer=0');
print_r($dsnParser->getParsed());
// (array) [
// 'protocol' => 'smtp',
// 'user' => 'suserweb',
// 'password' => 'S22jD7Po%.,/zu34k',
// 'host' => 'mail.domain.tld',
// 'port' => 25,
// 'options' => 'verify_peer=0',
// ]
```
## 2. Installation
```bash
composer require ixnode/php-dsn-parser
```
```bash
vendor/bin/php-dsn-parser -V
```
```bash
php-dsn-parser 0.1.0 (03-07-2023 01:17:26) - Björn Hempel
```
## 3. Library development
```bash
git clone git@github.com:ixnode/php-dsn-parser.git && cd php-dsn-parser
```
```bash
composer install
```
```bash
composer test
```
## 4. License
This library is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.