mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Tweak host port
This commit is contained in:
		
							parent
							
								
									26150f4e60
								
							
						
					
					
						commit
						4735f0c51e
					
				@ -457,10 +457,14 @@ class Runtime
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public function getSSHConfig()
 | 
					    public function getSSHConfig()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $sshConfig = $this->getEnvOption('ssh', ['flags' => '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no']);
 | 
					        $sshConfig = $this->getEnvOption('ssh', ['port' => 22, 'flags' => '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if ($this->getHostPort() !== null) {
 | 
				
			||||||
 | 
					            $sshConfig['port'] = $this->getHostPort();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!array_key_exists('port', $sshConfig)) {
 | 
					        if (!array_key_exists('port', $sshConfig)) {
 | 
				
			||||||
            $sshConfig['port'] = $this->getHostPort();
 | 
					            $sshConfig['port'] = '22';
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!array_key_exists('flags', $sshConfig)) {
 | 
					        if (!array_key_exists('flags', $sshConfig)) {
 | 
				
			||||||
@ -478,7 +482,7 @@ class Runtime
 | 
				
			|||||||
    public function getHostPort()
 | 
					    public function getHostPort()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $info = explode(':', $this->getWorkingHost());
 | 
					        $info = explode(':', $this->getWorkingHost());
 | 
				
			||||||
        return isset($info[1]) ? $info[1] : '22';
 | 
					        return isset($info[1]) ? $info[1] : null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user