21 lines
437 B
PHP
21 lines
437 B
PHP
<?php
|
|
|
|
namespace Core\Database;
|
|
|
|
class Connection
|
|
{
|
|
public static function make($config)
|
|
{
|
|
try {
|
|
return new \PDO(
|
|
"{$config['connection']};dbname={$config['name']};charset=utf8",
|
|
$config['username'],
|
|
$config['password'],
|
|
$config['options']
|
|
);
|
|
} catch (\PDOException $e) {
|
|
die($e->getMessage());
|
|
}
|
|
}
|
|
}
|