1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php class Connection { public static function make(array $config) { try { return new PDO( $config['dsn'], $config['username'], $config['password'], $config['options'] ); } catch (PDOException $error) { error_log($error->getMessage()); } } }