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;
	}
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;
	}
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 ; }
Add the host to the connection pool

@param  mixed  $host
@param  string $name
@throws OptionsError
@return MongoAdapter
Add the host to the connection pool