From 8511e2a251dd49b031bc90cdc3b4d651b96a9591 Mon Sep 17 00:00:00 2001 From: Stephen Ball Date: Sun, 4 Oct 2015 17:38:03 +0100 Subject: [PATCH 1/2] Adding support to check for .phpci.yml so the file can be 'hidden' as with other CI systems such as Travis, StyleCI and Codeclimate --- PHPCI/Model/Build.php | 5 +++++ PHPCI/Plugin/TechnicalDebt.php | 1 + 2 files changed, 6 insertions(+) diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php index a0019438..3e3ab3e2 100644 --- a/PHPCI/Model/Build.php +++ b/PHPCI/Model/Build.php @@ -104,6 +104,11 @@ class Build extends BuildBase $build_config = file_get_contents($buildPath . '/phpci.yml'); } + // Try .phpci.yml + if (empty($build_config) && is_file($buildPath . '/.phpci.yml')) { + $build_config = file_get_contents($buildPath . '/.phpci.yml'); + } + // Try getting the project build config from the database: if (empty($build_config)) { $build_config = $this->getProject()->getBuildConfig(); diff --git a/PHPCI/Plugin/TechnicalDebt.php b/PHPCI/Plugin/TechnicalDebt.php index 163c94c6..91f75d93 100755 --- a/PHPCI/Plugin/TechnicalDebt.php +++ b/PHPCI/Plugin/TechnicalDebt.php @@ -151,6 +151,7 @@ class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $ignores = $this->ignore; $ignores[] = 'phpci.yml'; + $ignores[] = '.phpci.yml'; foreach ($iterator as $file) { $filePath = $file->getRealPath(); From ad0fd5d00afd510479fdf31f252bac9224dc161e Mon Sep 17 00:00:00 2001 From: Stephen Ball Date: Mon, 5 Oct 2015 10:17:04 +0100 Subject: [PATCH 2/2] Update Build.php Changed the order the files are loaded in --- PHPCI/Model/Build.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php index 3e3ab3e2..3243f9fa 100644 --- a/PHPCI/Model/Build.php +++ b/PHPCI/Model/Build.php @@ -99,14 +99,14 @@ class Build extends BuildBase { $build_config = null; - // Try phpci.yml first: - if (is_file($buildPath . '/phpci.yml')) { - $build_config = file_get_contents($buildPath . '/phpci.yml'); + // Try .phpci.yml + if (is_file($buildPath . '/.phpci.yml')) { + $build_config = file_get_contents($buildPath . '/.phpci.yml'); } - // Try .phpci.yml - if (empty($build_config) && is_file($buildPath . '/.phpci.yml')) { - $build_config = file_get_contents($buildPath . '/.phpci.yml'); + // Try phpci.yml first: + if (empty($build_config) && is_file($buildPath . '/phpci.yml')) { + $build_config = file_get_contents($buildPath . '/phpci.yml'); } // Try getting the project build config from the database: