| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function __construct($config) |
||
| 29 | { |
||
| 30 | $this->config = $config; |
||
| 31 | |||
| 32 | if(is_null(self::$instance)){ |
||
| 33 | |||
| 34 | //get pdo dsn |
||
| 35 | $dsn=''.$config['driver'].':host='.$config['host'].';dbname='.$config['database'].''; |
||
| 36 | $this->connection = new \PDO($dsn, $config['user'], $config['password']); |
||
| 37 | $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
||
| 38 | |||
| 39 | self::$instance=true; |
||
| 40 | } |
||
| 61 | } |