From a4f111deff4d0bc9283f35697ddafbf810416e99 Mon Sep 17 00:00:00 2001 From: Bradley Weston Date: Wed, 18 Jun 2014 10:20:42 +0100 Subject: [PATCH 1/2] SSH I'm currently running Windows machine and cygwin. This causes a hang because it requires user input. This causes the request just to go on forever until the connection is either closed or maximum execution time is reached. So how I have thought to solve it is to add the help option. --- PHPCI/Helper/SshKey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHPCI/Helper/SshKey.php b/PHPCI/Helper/SshKey.php index 77c4a64a..4c625ff4 100644 --- a/PHPCI/Helper/SshKey.php +++ b/PHPCI/Helper/SshKey.php @@ -45,7 +45,7 @@ class SshKey public function canGenerateKeys() { - $keygen = @shell_exec('ssh-keygen'); + $keygen = @shell_exec('ssh-keygen -h'); $canGenerateKeys = !empty($keygen); return $canGenerateKeys; From d8bf99be8eaf1874343832352f8e52d287de9cf3 Mon Sep 17 00:00:00 2001 From: Bradley Weston Date: Wed, 18 Jun 2014 10:25:24 +0100 Subject: [PATCH 2/2] SshKey generate always returns an array. --- PHPCI/Controller/ProjectController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index be31eebd..ee03f617 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -166,9 +166,9 @@ class ProjectController extends \PHPCI\Controller $sshKey = new SshKey(); $key = $sshKey->generate(); - $values['key'] = $key ? $key['private_key'] : ''; - $values['pubkey'] = $key ? $key['public_key'] : ''; - $pub = $key ? $key['public_key'] : ''; + $values['key'] = isset($key['private_key']) ? $key['private_key'] : ''; + $values['pubkey'] = isset($key['public_key']) ? $key['public_key'] : ''; + $pub = isset($key['public_key']) ? $key['public_key'] : ''; } $form = $this->projectForm($values);