|
| 1 | +# PHP DSN Parser |
| 2 | + |
| 3 | +[](https://github.com/ixnode/php-dsn-parser/releases) |
| 4 | +[](https://github.com/ixnode/php-dsn-parser/releases) |
| 5 | + |
| 6 | +[](https://www.php.net/supported-versions.php) |
| 7 | +[](https://phpstan.org/user-guide/rule-levels) |
| 8 | +[](https://phpunit.de) |
| 9 | +[](https://www.php-fig.org/psr/psr-12/) |
| 10 | +[](https://github.com/phpmd/phpmd) |
| 11 | +[](https://github.com/rectorphp/rector) |
| 12 | +[](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE) |
| 13 | + |
| 14 | +> This library helps to parse DSN\URI strings. |
| 15 | +
|
| 16 | +## 1. Usage |
| 17 | + |
| 18 | +```php |
| 19 | +use Ixnode\PhpDsnParser\DsnParser; |
| 20 | +``` |
| 21 | + |
| 22 | +```php |
| 23 | +$dsnParser = new DsnParser('smtp://suserweb:S22jD7Po%.,/ [email protected]:25?verify_peer=0'); |
| 24 | + |
| 25 | +print_r($dsnParser->getParsed()); |
| 26 | +// (array) [ |
| 27 | +// 'protocol' => 'smtp', |
| 28 | +// 'user' => 'suserweb', |
| 29 | +// 'password' => 'S22jD7Po%.,/zu34j', |
| 30 | +// 'host' => 'mail.domain.tld', |
| 31 | +// 'port' => 25, |
| 32 | +// 'options' => 'verify_peer=0', |
| 33 | +// ] |
| 34 | +``` |
| 35 | + |
| 36 | +## 2. Installation |
| 37 | + |
| 38 | +```bash |
| 39 | +composer require ixnode/php-dsn-parser |
| 40 | +``` |
| 41 | + |
| 42 | +```bash |
| 43 | +vendor/bin/php-dsn-parser -V |
| 44 | +``` |
| 45 | + |
| 46 | +```bash |
| 47 | +php-dsn-parser 0.1.0 (03-07-2023 01:17:26) - Björn Hempel <[email protected]> |
| 48 | +``` |
| 49 | + |
| 50 | +## 3. Library development |
| 51 | + |
| 52 | +```bash |
| 53 | +git clone [email protected]:ixnode/php-dsn-parser.git && cd php-dsn-parser |
| 54 | +``` |
| 55 | + |
| 56 | +```bash |
| 57 | +composer install |
| 58 | +``` |
| 59 | + |
| 60 | +```bash |
| 61 | +composer test |
| 62 | +``` |
| 63 | + |
| 64 | +## 4. License |
| 65 | + |
| 66 | +This library is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details. |
0 commit comments