From 0a9c7bda93206013387f41be5bb4f4b7447e7f86 Mon Sep 17 00:00:00 2001 From: meadsteve Date: Tue, 14 May 2013 18:01:14 +0100 Subject: [PATCH 1/2] 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'); From bdaf5abff7346382f1d0f5c9fb45aa5316476fae Mon Sep 17 00:00:00 2001 From: meadsteve Date: Tue, 14 May 2013 18:07:46 +0100 Subject: [PATCH 2/2] I've replaced the requirement for the pecl yaml extension with the symphony component. Sometimes I work on a windows box and the instructions for installing pecl yaml on windows looked a little intimidating: https://code.google.com/p/php-yaml/wiki/InstallingWithPecl --- PHPCI/Builder.php | 5 ++++- composer.json | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php index 7c3c1dc1..1f9d29b1 100644 --- a/PHPCI/Builder.php +++ b/PHPCI/Builder.php @@ -3,6 +3,7 @@ namespace PHPCI; use PHPCI\Model\Build; use b8\Store; +use Symfony\Component\Yaml\Parser as YamlParser; class Builder { @@ -153,7 +154,9 @@ class Builder return false; } - $this->config = yaml_parse_file($this->buildPath . 'phpci.yml'); + $yamlParser = new YamlParser(); + $yamlFile = file_get_contents($this->buildPath . 'phpci.yml'); + $this->config = $yamlParser->parse($yamlFile); if(!isset($this->config['verbose']) || !$this->config['verbose']) { diff --git a/composer.json b/composer.json index 22367854..78e5eefe 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,6 @@ "squizlabs/php_codesniffer": "1.*", "ircmaxell/password-compat": "1.x", "phpspec/phpspec": "2.*", - "ext-yaml": "*" + "symfony/yaml": "2.2.x-dev" } -} \ No newline at end of file +}