Initial commit
This commit is contained in:
commit
5ed6195cc1
41 changed files with 3429 additions and 0 deletions
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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue