2017 © Pedro Peláez
 

library dsn

DSN string helper

image

yep/dsn

DSN string helper

  • Monday, June 13, 2016
  • by yep
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality Scrutinizer Code Coverage Latest Stable Version Total Downloads License, (*1)

Dsn

Packagist

Dsn is available on Packagist.org, just add the dependency to your composer.json., (*2)

{
  "require" : {
    "yep/dsn": "dev-master"
  }
}

Usage

You can use MySqlDsn, MySqlUnixSocketDsn, PostgreSqlDsn, Sqlite2Dsn or SqliteDsn., (*3)

<?php
$dsn = new Yep\Dsn\MySqlDsn(
  $dbName = 'database',
  $host = 'localhost',
  $port = 3306
);

echo $dsn->toString(); // mysql:host=localhost;dbname=database;port=3306
// or
echo $dsn; // mysql:host=localhost;dbname=database;port=3306

// Usage with PDO
$pdo = new PDO($dsn, 'root');

The Versions

13/06 2016

dev-master

9999999-dev https://github.com/YepFoundation/dsn

DSN string helper

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

  • php >=7.0.0

 

The Development Requires

helper dsn