public function chdir($dir) {
		$this->connectIfNeeded();
		$this->handle->chdir($dir);
		$this->onFolderChanged(new Event(['sender' => $this, 'data' => $dir]));
		try {
			$cwd = $this->pwd();
		} catch (FtpException $ex) {
			$cwd = $dir;	
		}
		return $cwd;
	}
public function chdir($dir) {
		$this->connectIfNeeded();
		$this->handle->chdir($dir);
		$this->onFolderChanged(new Event(['sender' => $this, 'data' => $dir]));
		try {
			$cwd = $this->pwd();
		} catch (FtpException $ex) {
			$cwd = $dir;	
		}
		return $cwd;
	}
public function chdir ( $ dir ) { $ this -> connectIfNeeded ( ) ; $ this -> handle -> chdir ( $ dir ) ; $ this -> onFolderChanged ( new Event ( [ 'sender' => $ this , 'data' => $ dir ] ) ) ; try { $ cwd = $ this -> pwd ( ) ; } catch ( FtpException $ ex ) { $ cwd = $ dir ; } return $ cwd ; }
Changes current folder.

@param string    $dir           Folder to move on (relative or absolute path).

@return string Current folder on FTP server.

@throws FtpException If folder deletion failed.
Changes current folder .