/** * Get the SSH configuration file instance. * * @param string $user * @return \Laravel\Envoy\SSHConfigFile */ protected function getSshConfig($user) { if (file_exists($path = $this->getHomeDirectory($user) . '/.ssh/config')) { return SSHConfigFile::parse($path); } }
private function parse($config) { $sshConfig = SSHConfigFile::parseString($config); $r = new \ReflectionObject($sshConfig); $property = $r->getProperty('groups'); $property->setAccessible(true); return $property->getValue($sshConfig); }