lithium\data\source\database\adapter\MySql::_dsn PHP Method

_dsn() protected method

Builds DSN string.
protected _dsn ( ) : string
return string
    protected function _dsn()
    {
        $host = $this->_config['host'];
        if ($host[0] === '/') {
            return sprintf('mysql:unix_socket=%s;dbname=%s', $host, $this->_config['database']);
        }
        list($host, $port) = explode(':', $host) + array(1 => "3306");
        return sprintf('mysql:host=%s;port=%s;dbname=%s', $host, $port, $this->_config['database']);
    }