public static function parseConnectionUrl($connectionUrl)
	{

		// Parse Url for parts
		$url = @parse_url($connectionUrl);

		// No host?!
		if (!isset($url['host'])) {
			throw new DatabaseException('Database host must be specified in the connection string. If you want to specify an absolute filename, use e.g. sqlite://unix(/path/to/file)');
		}	

		// Create info object
		$info = new \stdClass();
		$info->protocol = $url['scheme'];
		$info->host = $url['host'];
		$info->db = isset($url['path']) ? substr($url['path'], 1) : null;
		$info->user = isset($url['user']) ? $url['user'] : null;
		$info->pass = isset($url['pass']) ? $url['pass'] : null;

		$allowBlankDb = ($info->protocol == 'sqlite');

		if ($info->host == 'unix(') {
			$socketDatabase = $info->host . '/' . $info->db;

			if ($allowBlankDb)
				$unixRegex = '/^unix\((.+)\)\/?().*$/';
			else
				$unixRegex = '/^unix\((.+)\)\/(.+)$/';

			if (preg_match_all($unixRegex, $socketDatabase, $matches) > 0)
			{
				$info->host = $matches[1][0];
				$info->db = $matches[2][0];
			}

		} elseif (substr($info->host, 0, 8) == 'windows(') {

			$info->host = urldecode(substr($info->host, 8) . '/' . substr($info->db, 0, -1));
			$info->db = null;

		}

		if ($allowBlankDb && $info->db) {
			$info->host .= '/' . $info->db;
		}

		if (isset($url['port'])) {
			$info->port = $url['port'];
		}

		if (strpos($connectionUrl, 'decode=true') !== false)
		{
			if ($info->user)
				$info->user = urldecode($info->user);

			if ($info->pass)
				$info->pass = urldecode($info->pass);
		}

		if (isset($url['query'])) {
			foreach (explode('/&/', $url['query']) as $pair) {
				list($name, $value) = explode('=', $pair);

				if ($name == 'charset') {
					$info->charset = $value;
				}
			}
		}

		return $info;
	}