From 0a9c7bda93206013387f41be5bb4f4b7447e7f86 Mon Sep 17 00:00:00 2001 From: meadsteve Date: Tue, 14 May 2013 18:01:14 +0100 Subject: [PATCH] On a windows system having a file path like '/tmp/' . md5(microtime(true)) caused problems. I've updated this to use the system temp directory. --- PHPCI/Controller/ProjectController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index d0834df8..ebbf1375 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -88,7 +88,11 @@ class ProjectController extends b8\Controller } else { - $id = '/tmp/' . md5(microtime(true)); + $tempPath = sys_get_temp_dir() . '/tmp/'; + $id = $tempPath . md5(microtime(true)); + if (!is_dir($tempPath)) { + mkdir($tempPath); + } shell_exec('ssh-keygen -q -t rsa -b 2048 -f '.$id.' -N "" -C "deploy@phpci"'); $pub = file_get_contents($id . '.pub');