Initial commit
This commit is contained in:
20
core/database/Connection.php
Normal file
20
core/database/Connection.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?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());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user