SlightPHP\DbPDO::connect PHP Method

connect() public method

public connect ( )
    public function connect()
    {
        $tmp = explode("_", $this->_engine);
        $driver = $tmp[1];
        try {
            $this->_pdo = new \PDO($driver . ":dbname=" . $this->_database . ";host=" . $this->_host . ";port=" . $this->_port, $this->_user, $this->_password, array(\PDO::ATTR_PERSISTENT => $this->_persistent));
        } catch (\PDOException $e) {
            trigger_error("CONNECT DATABASE ERROR ( " . $e->getMessage() . " ) ", E_USER_WARNING);
            return false;
        }
        if (!empty($this->_charset)) {
            $this->_pdo->exec("SET NAMES " . $this->_charset);
        }
        return true;
    }