mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-25 20:08:23 +02:00
Started work in SQLite support
This commit is contained in:
parent
d7e7408072
commit
738985b256
4 changed files with 900 additions and 4 deletions
|
@ -29,10 +29,15 @@ try {
|
|||
// Create PDO instance
|
||||
if ($dbDriver == 'mysql') {
|
||||
$dsn = "mysql:host=$dbHost;dbname=$dbName;charset=utf8";
|
||||
$pdo = new PDO($dsn, $dbUser, $dbPass);
|
||||
} elseif ($dbDriver == 'pgsql') {
|
||||
$dsn = "pgsql:host=$dbHost;dbname=$dbName";
|
||||
$pdo = new PDO($dsn, $dbUser, $dbPass);
|
||||
} elseif ($dbDriver == 'sqlite') {
|
||||
$dsn = "sqlite:/var/www/cp/registry.db";
|
||||
$pdo = new PDO($dsn);
|
||||
}
|
||||
$pdo = new PDO($dsn, $dbUser, $dbPass);
|
||||
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
// SQL query
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue