From 1f9ec69c521d636d3025f200f70ac3d822b9f144 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 19:55:29 +0700 Subject: [PATCH 1/7] Fixed gray block style (grey -> gray) --- public/assets/css/main.css | 3 ++- src/PHPCensor/View/Home/ajax-dashboard-project.phtml | 4 ++-- src/PHPCensor/View/Home/dashboard-projects.phtml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/assets/css/main.css b/public/assets/css/main.css index 54e49e4b..12468cf4 100644 --- a/public/assets/css/main.css +++ b/public/assets/css/main.css @@ -585,7 +585,8 @@ h6, } .bg-gray { - color: #666; + background-color: #8aa4af; + color: #fff !important; } .timeline > .time-label > span { diff --git a/src/PHPCensor/View/Home/ajax-dashboard-project.phtml b/src/PHPCensor/View/Home/ajax-dashboard-project.phtml index 29ffac4d..892b8fa6 100644 --- a/src/PHPCensor/View/Home/ajax-dashboard-project.phtml +++ b/src/PHPCensor/View/Home/ajax-dashboard-project.phtml @@ -3,7 +3,7 @@ use PHPCensor\Helper\Lang; $statuses = []; $failures = 0; -$subcls = 'grey'; +$subcls = 'gray'; $cls = ''; $success = null; $failure = null; @@ -103,7 +103,7 @@ if ($buildCount > 0) { '; + echo ''; } else { $build = $builds[$idx]; $link = APP_URL . 'build/view/' . $build->id; diff --git a/src/PHPCensor/View/Home/dashboard-projects.phtml b/src/PHPCensor/View/Home/dashboard-projects.phtml index 0ea6fb8d..764b7936 100644 --- a/src/PHPCensor/View/Home/dashboard-projects.phtml +++ b/src/PHPCensor/View/Home/dashboard-projects.phtml @@ -4,7 +4,7 @@ use PHPCensor\Helper\Lang; foreach($projects as $project): $statuses = []; $failures = 0; - $subcls = 'grey'; + $subcls = 'gray'; $cls = ''; $success = null; $failure = null; @@ -104,7 +104,7 @@ foreach($projects as $project): getId()][$idx])) { - echo ''; + echo ''; } else { $build = $builds[$project->getId()][$idx]; $link = APP_URL . 'build/view/' . $build->id; From c752651d109937ba2915659093daffa97242235c Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 20:09:33 +0700 Subject: [PATCH 2/7] Fixed environment field in build table --- .../20170416130610_fixed_environments.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/PHPCensor/Migrations/20170416130610_fixed_environments.php diff --git a/src/PHPCensor/Migrations/20170416130610_fixed_environments.php b/src/PHPCensor/Migrations/20170416130610_fixed_environments.php new file mode 100644 index 00000000..8c2b96b4 --- /dev/null +++ b/src/PHPCensor/Migrations/20170416130610_fixed_environments.php @@ -0,0 +1,28 @@ +table('build'); + + if ($table->hasColumn('environment')) { + $table + ->changeColumn('environment', 'string', ['limit' => 250, 'null' => true]) + ->save(); + } + } + + public function down() + { + $table = $this->table('build'); + + if ($table->hasColumn('environment')) { + $table + ->changeColumn('environment', 'string', ['limit' => 250, 'null' => false]) + ->save(); + } + } +} From 42a9d7fc943312d460cb956c89e581f4f9d196d3 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 20:17:55 +0700 Subject: [PATCH 3/7] Fixed gray block style (grey -> gray) +++ --- public/assets/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/css/main.css b/public/assets/css/main.css index 12468cf4..92b07137 100644 --- a/public/assets/css/main.css +++ b/public/assets/css/main.css @@ -585,7 +585,7 @@ h6, } .bg-gray { - background-color: #8aa4af; + background-color: #8aa4af !important; color: #fff !important; } From a671f4d81dcf52c9b8adc4ed0878e6a0d49877d1 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 20:46:51 +0700 Subject: [PATCH 4/7] Improved error page --- src/B8Framework/Controller.php | 2 +- src/PHPCensor/View/exception.phtml | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/B8Framework/Controller.php b/src/B8Framework/Controller.php index ac9e2171..03bbf47e 100644 --- a/src/B8Framework/Controller.php +++ b/src/B8Framework/Controller.php @@ -39,7 +39,7 @@ abstract class Controller public function __construct(Config $config, Request $request, Response $response) { - $this->config = $config; + $this->config = $config; $this->request = $request; $this->response = $response; } diff --git a/src/PHPCensor/View/exception.phtml b/src/PHPCensor/View/exception.phtml index 74f97fd0..dddfdd01 100644 --- a/src/PHPCensor/View/exception.phtml +++ b/src/PHPCensor/View/exception.phtml @@ -3,7 +3,15 @@

Sorry, there was a problem

+
- getMessage(); ?> + getMessage(); ?>
+ File: getFile(); ?>
+ Line: getLine(); ?>
+
+            getTraceAsString(); ?>
+        
\ No newline at end of file From 142f05b416b6f0659cf3bfe956f1fba928811421 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 21:18:21 +0700 Subject: [PATCH 5/7] Fixed Database::lastInsertId call for PostgreSQL --- src/B8Framework/Database.php | 14 ++++++++++++++ src/B8Framework/Store.php | 16 +++++++++------- src/PHPCensor/View/exception.phtml | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/B8Framework/Database.php b/src/B8Framework/Database.php index f48aef76..29487b42 100644 --- a/src/B8Framework/Database.php +++ b/src/B8Framework/Database.php @@ -10,6 +10,20 @@ class Database extends \PDO protected static $details = []; protected static $lastUsed = ['read' => null, 'write' => null]; + /** + * @param string $table + * + * @return string + */ + public function lastInsertIdExtended($table = null) + { + if ($table && $this->getAttribute(self::ATTR_DRIVER_NAME) == 'pgsql') { + return parent::lastInsertId($table . '_id_seq'); + } + + return parent::lastInsertId(); + } + protected static function init() { $config = Config::getInstance(); diff --git a/src/B8Framework/Store.php b/src/B8Framework/Store.php index 9cbe4997..bf6b5282 100644 --- a/src/B8Framework/Store.php +++ b/src/B8Framework/Store.php @@ -251,26 +251,28 @@ abstract class Store public function saveByInsert(Model $obj, $saveAllColumns = false) { - $rtn = null; - $data = $obj->getDataArray(); + $rtn = null; + $data = $obj->getDataArray(); $modified = ($saveAllColumns) ? array_keys($data) : $obj->getModified(); $cols = []; $values = []; $qParams = []; foreach ($modified as $key) { - $cols[] = $key; - $values[] = ':' . $key; + $cols[] = $key; + $values[] = ':' . $key; $qParams[':' . $key] = $data[$key]; } if (count($cols)) { - $qs = 'INSERT INTO {{' . $this->tableName . '}} (' . implode(', ', $cols) . ') VALUES (' . implode(', ', - $values) . ')'; + $qs = 'INSERT INTO {{' . $this->tableName . '}} (' . implode(', ', $cols) . ') VALUES (' . implode(', ', $values) . ')'; $q = Database::getConnection('write')->prepareCommon($qs); if ($q->execute($qParams)) { - $id = !empty($data[$this->primaryKey]) ? $data[$this->primaryKey] : Database::getConnection('write')->lastInsertId(); + $id = !empty($data[$this->primaryKey]) + ? $data[$this->primaryKey] + : Database::getConnection('write')->lastInsertIdExtended($obj->getTableName()); + $rtn = $this->getByPrimaryKey($id, 'write'); } } diff --git a/src/PHPCensor/View/exception.phtml b/src/PHPCensor/View/exception.phtml index dddfdd01..071d9c06 100644 --- a/src/PHPCensor/View/exception.phtml +++ b/src/PHPCensor/View/exception.phtml @@ -9,7 +9,7 @@
getMessage(); ?>
File: getFile(); ?>
- Line: getLine(); ?>
+ Line: getLine(); ?>
             getTraceAsString(); ?>
         
From 3bd5b2c71855106c26147ec166174fdb53e3e664 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 21:37:55 +0700 Subject: [PATCH 6/7] Improved error page +++ --- src/PHPCensor/Controller/ProjectController.php | 1 + src/PHPCensor/View/exception.phtml | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PHPCensor/Controller/ProjectController.php b/src/PHPCensor/Controller/ProjectController.php index f95954c9..d2d82874 100644 --- a/src/PHPCensor/Controller/ProjectController.php +++ b/src/PHPCensor/Controller/ProjectController.php @@ -156,6 +156,7 @@ class ProjectController extends PHPCensor\Controller $response = new b8\Http\Response\RedirectResponse(); $response->setHeader('Location', APP_URL.'build/view/' . $build->getId()); + return $response; } diff --git a/src/PHPCensor/View/exception.phtml b/src/PHPCensor/View/exception.phtml index 071d9c06..69aeb124 100644 --- a/src/PHPCensor/View/exception.phtml +++ b/src/PHPCensor/View/exception.phtml @@ -7,11 +7,10 @@ /** @var $exception \Exception */ ?>
- getMessage(); ?>
- File: getFile(); ?>
- Line: getLine(); ?> -
-            getTraceAsString(); ?>
-        
+ Message: getMessage(); ?>
+ File: getFile(); ?>
+ Line: getLine(); ?>
+ Trace: +
getTraceAsString(); ?>
\ No newline at end of file From aeb62484363c96c291ed84210c72c8a3c718fda4 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 16 Apr 2017 22:08:14 +0700 Subject: [PATCH 7/7] Fixes --- .php-censor.yml | 5 ++--- README.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.php-censor.yml b/.php-censor.yml index 4f4bf834..52d8c12d 100644 --- a/.php-censor.yml +++ b/.php-censor.yml @@ -33,9 +33,8 @@ test: php_docblock_checker: allow_failures: true -failure: - email: - committer: false + security_checker: + allow_failures: true complete: email: diff --git a/README.md b/README.md index d9175fb8..e0b3a2b3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![PHPCensor](http://phpci.corpsee.com/build-status/image/9?branch=master&label=PHPCensor&style=flat-square)](http://phpci.corpsee.com/build-status/view/9?branch=master) +[![PHPCensor](http://php-censor.corpsee.com/build-status/image/6?branch=master&label=PHPCensor&style=flat-square)](http://php-censor.corpsee.com/build-status/view/6?branch=master) [![TravisCI](https://img.shields.io/travis/corpsee/php-censor/master.svg?label=TravisCI&style=flat-square)](https://travis-ci.org/corpsee/php-censor?branch=master) [![Latest Version](https://img.shields.io/packagist/v/corpsee/php-censor.svg?label=Version&style=flat-square)](https://packagist.org/packages/corpsee/php-censor) [![Total downloads](https://img.shields.io/packagist/dt/corpsee/php-censor.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/corpsee/php-censor)