ixnode / php-dsn-parser
PHP DSN parser - This library helps to parse DSN\URI strings.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Language:Shell
Requires
- php: ^8.2
- ext-curl: *
- ext-gd: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- ixnode/bash-version-manager: ^0.1.3
- jetbrains/phpstorm-attributes: ^1.0
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5
- povils/phpmnd: ^3.0
- rector/rector: ^0.15.1
README
This library helps to parse DSN\URI strings.
1. Usage
use Ixnode\PhpDsnParser\DsnParser;
$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
composer require ixnode/php-dsn-parser
vendor/bin/php-dsn-parser -V
php-dsn-parser 0.1.0 (03-07-2023 01:17:26) - Björn Hempel <bjoern@hempel.li>
3. Library development
git clone git@github.com:ixnode/php-dsn-parser.git && cd php-dsn-parser
composer install
composer test
4. License
This library is licensed under the MIT License - see the LICENSE file for details.