public function addHost($host, $name = null) {
		$host = $this->normalizeHost($host);
		
		if ($host->hasUsername()) {
			$this->setUsername($host->getUsername());
			$host->removeUsername();
			
			if ($host->hasPassword()) {
				$this->setPassword($host->getPassword());
				$host->removePassword();
			}
		}
		
		if ($host->hasPath()) {
			$this->setDBName(trim($host->getPath(), '/'));
			$host->removePath();
		}
		
		$host->removeScheme();
		
		if ($name === null) {
			$this->hosts[] = $host;
			return $this;
		}
		
		$this->hosts[$name] = $host;
		return $this;
	}