Пример #1
0
 public function nodesFromSSHConfigHosts($paths = array())
 {
     $configPaths = array();
     if (is_string($paths)) {
         $configPaths[] = $paths;
     } else {
         $configPaths = $paths;
     }
     if (sizeof($configPaths) < 1) {
         $configPaths = array("/etc/ssh_config", "/etc/ssh/ssh_config", Env::get("homedir") . "/.ssh/config");
     }
     $nodesOptions = SSHConfig::parseToNodeOptionsFromFiles($configPaths);
     foreach ($nodesOptions as $key => $option) {
         $this->node($key, $option);
     }
 }
Пример #2
0
 public function testParseWithSpeceialComment()
 {
     $config = SSHConfig::parse(file_get_contents(__DIR__ . "/SSHConfigTest/ssh_config4"));
     //        print_r($config);
     $this->assertEquals("true", $config["test-server1"]["altax.ignore"]);
 }