Kartmax-technology / kartmax-dsn-parser by kartmax-tech

A DSN parser for Mysql connection to support Laravel, Lumen and Core PHP
264
0
1
Package Data
Maintainer Username: kartmax-tech
Maintainer Contact: sagar.chauhan@greenhonchos.com (Sagar Chauhan)
Package Create Date: 2023-11-02
Package Last Update: 2023-11-03
Language: PHP
License: MIT
Last Refreshed: 2024-05-02 03:00:07
Package Statistics
Total Downloads: 264
Monthly Downloads: 15
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

DSN Parser

A simple DSN parser for PHP projects.

Installation

Via Composer: composer require kartmax/dsn-parser "^1.0.2"

Sample DSN

MYSQL_VX_CART_DB_DSN_READ_ONLY=mysql://user:password@127.0.0.1:3306/dbname?charset=utf8mb4

Usage

$dsnDetails = DsnParser::parse();

## Installation for Laravel

If you're using Laravel 5.5 and above, the package will automatically register its service provider.

For older versions of Laravel:

Add the service provider to the `providers` array in `config/app.php`:

```php
DsnParser\Providers\DsnServiceProvider::class,

Installation for Lumen

Register the service provider in bootstrap/app.php:

$app->register(DsnParser\Providers\DsnServiceProvider::class);