final protected function URLToString(array $components = array(
		'scheme',
		'user',
		'pass',
		'host',
		'port',
		'path',
		'query',
		'fragment'
	))
	{
		$url = '';
		$query = "{$this->query}";
		if (in_array('scheme', $components)) {
			if (is_string($this->_url_data['scheme'])) {
				$url .= rtrim($this->_url_data['scheme'], ':/') . '://';
			} else {
				$url .= 'http://';
			}
		}

		if (@is_string($this->_url_data['user']) and in_array('user', $components)) {
			$url .= urlencode($this->_url_data['user']);
			if (@is_string($this->_url_data['pass']) and in_array('pass', $components)) {
				$url .= ':' . urlencode($this->_url_data['pass']);
			}
			$url .= '@';
		}

		if (in_array('host', $components)) {
			if (@is_string($this->_url_data['host'])) {
				$url .= $this->_url_data['host'];
			} else {
				$url .= 'localhost';
			}
		}
		if (
			is_int($this->_url_data['port'])
			and ! $this->isDefaultPort($this->_url_data['scheme'], $this->_url_data['port'])
		) {
			$url .= ":{$this->_url_data['port']}";
		}
		if (in_array('path', $components)) {
			if (@is_string($this->_url_data['path'])) {
				$url .= '/' . ltrim($this->_url_data['path'], '/');
			} else {
				$url .= '/';
			}
		}

		if(
			strlen($query) !== 0 and in_array('query', $components)
		) {
			$url .= "?$query";
		}
		if (@is_string($this->_url_data['fragment']) and in_array('fragment', $components)) {
			$url .= '#' . ltrim($this->_url_data['fragment'], '#');
		}
		return $url;
	}