dev-master
9999999-dev https://github.com/YepFoundation/dsnDSN string helper
GPL-3.0 BSD-3-Clause GPL-2.0
The Requires
- php >=7.0.0
The Development Requires
helper dsn
Wallogit.com
2017 © Pedro Peláez
DSN string helper
Dsn is available on Packagist.org, just add the dependency to your composer.json., (*2)
{
"require" : {
"yep/dsn": "dev-master"
}
}
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');
DSN string helper
GPL-3.0 BSD-3-Clause GPL-2.0
helper dsn