From e5d4491ec18595271bd8605666e479a033c97311 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 31 Aug 2018 18:53:09 +0900 Subject: [PATCH 01/40] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=9F=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E5=A4=89=E6=9B=B4=E3=80=82=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E6=A8=A9=E3=82=92=E5=A4=96=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Elements/public_type.ctp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 View/Elements/public_type.ctp diff --git a/View/Elements/public_type.ctp b/View/Elements/public_type.ctp old mode 100755 new mode 100644 From 035b157601934c8dde12635de8ca2d194f3c6b01 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Feb 2019 14:27:00 +0900 Subject: [PATCH 02/40] =?UTF-8?q?Current=E3=81=AE=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E6=94=B9=E5=96=84=E3=81=AE=E3=81=9F=E3=82=81=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF=E3=82=B9=E4=BB=98=E4=B8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1551245049_improve_performance_current.php | 79 +++++++++++++++++++ Config/Schema/schema.php | 5 +- 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Config/Migration/1551245049_improve_performance_current.php diff --git a/Config/Migration/1551245049_improve_performance_current.php b/Config/Migration/1551245049_improve_performance_current.php new file mode 100644 index 0000000..b9b8c35 --- /dev/null +++ b/Config/Migration/1551245049_improve_performance_current.php @@ -0,0 +1,79 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('NetCommonsMigration', 'NetCommons.Config/Migration'); + +/** + * Currentライブラリの速度改善 + * + * @author Shohei Nakajima + * @package NetCommons\Blocks\Config\Migration + */ +class ImprovePerformanceCurrent extends NetCommonsMigration { + +/** + * Migration description + * + * @var string + */ + public $description = 'improve_performance_current'; + +/** + * Actions to be performed + * + * @var array $migration + */ + public $migration = array( + 'up' => array( + 'alter_field' => array( + 'block_settings' => array( + 'block_key' => array('type' => 'string', 'null' => true, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + ), + ), + 'create_field' => array( + 'block_settings' => array( + 'indexes' => array( + 'block_key' => array('column' => array('block_key', 'room_id', 'field_name', 'plugin_key', 'value'), 'unique' => 0), + ), + ), + ), + ), + 'down' => array( + 'alter_field' => array( + 'block_settings' => array( + 'block_key' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + ), + ), + 'drop_field' => array( + 'block_settings' => array('indexes' => array('block_key')), + ), + ), + ); + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + return true; + } +} diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php index e8fc2ac..2990d5e 100644 --- a/Config/Schema/schema.php +++ b/Config/Schema/schema.php @@ -76,7 +76,7 @@ public function after($event = array()) { 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), 'plugin_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'block_key' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + 'block_key' => array('type' => 'string', 'null' => true, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'field_name' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'value' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'type' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), @@ -86,7 +86,8 @@ public function after($event = array()) { 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 'indexes' => array( 'PRIMARY' => array('column' => 'id', 'unique' => 1), - 'plugin_key' => array('column' => array('plugin_key', 'room_id', 'block_key', 'field_name'), 'unique' => 0) + 'plugin_key' => array('column' => array('plugin_key', 'room_id', 'block_key', 'field_name'), 'unique' => 0), + 'block_key' => array('column' => array('block_key', 'room_id', 'field_name', 'plugin_key', 'value'), 'unique' => 0) ), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') ); From ef8c3756f60c8ed9dd33f4f52f0319438f5f1f60 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Feb 2019 15:02:53 +0900 Subject: [PATCH 03/40] =?UTF-8?q?Current=E3=81=AE=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E6=94=B9=E5=96=84=E3=81=AE=E3=81=9F=E3=82=81=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF=E3=82=B9=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Migration/1551245049_improve_performance_current.php | 2 +- Config/Schema/schema.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Config/Migration/1551245049_improve_performance_current.php b/Config/Migration/1551245049_improve_performance_current.php index b9b8c35..94aa4e4 100644 --- a/Config/Migration/1551245049_improve_performance_current.php +++ b/Config/Migration/1551245049_improve_performance_current.php @@ -40,7 +40,7 @@ class ImprovePerformanceCurrent extends NetCommonsMigration { 'create_field' => array( 'block_settings' => array( 'indexes' => array( - 'block_key' => array('column' => array('block_key', 'room_id', 'field_name', 'plugin_key', 'value'), 'unique' => 0), + 'block_key' => array('column' => array('block_key', 'field_name', 'room_id', 'plugin_key', 'value'), 'unique' => 0), ), ), ), diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php index 2990d5e..f916792 100644 --- a/Config/Schema/schema.php +++ b/Config/Schema/schema.php @@ -87,7 +87,7 @@ public function after($event = array()) { 'indexes' => array( 'PRIMARY' => array('column' => 'id', 'unique' => 1), 'plugin_key' => array('column' => array('plugin_key', 'room_id', 'block_key', 'field_name'), 'unique' => 0), - 'block_key' => array('column' => array('block_key', 'room_id', 'field_name', 'plugin_key', 'value'), 'unique' => 0) + 'block_key' => array('column' => array('block_key', 'field_name', 'room_id', 'plugin_key', 'value'), 'unique' => 0) ), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') ); From 3a6a6a90830a4fe05310ce4f563228145670d293 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Feb 2019 16:15:21 +0900 Subject: [PATCH 04/40] =?UTF-8?q?Current=E3=81=AE=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E6=94=B9=E5=96=84=E3=81=AE=E3=81=9F=E3=82=81=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF=E3=82=B9=E4=BB=98=E4=B8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...51251647_improve_performance_current_2.php | 79 +++++++++++++++++++ Config/Schema/schema.php | 5 +- 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Config/Migration/1551251647_improve_performance_current_2.php diff --git a/Config/Migration/1551251647_improve_performance_current_2.php b/Config/Migration/1551251647_improve_performance_current_2.php new file mode 100644 index 0000000..b5bac19 --- /dev/null +++ b/Config/Migration/1551251647_improve_performance_current_2.php @@ -0,0 +1,79 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('NetCommonsMigration', 'NetCommons.Config/Migration'); + +/** + * Currentライブラリの速度改善 + * + * @author Shohei Nakajima + * @package NetCommons\Blocks\Config\Migration + */ +class ImprovePerformanceCurrent2 extends NetCommonsMigration { + +/** + * Migration description + * + * @var string + */ + public $description = 'improve_performance_current_2'; + +/** + * Actions to be performed + * + * @var array $migration + */ + public $migration = array( + 'up' => array( + 'alter_field' => array( + 'block_role_permissions' => array( + 'block_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + ), + ), + 'create_field' => array( + 'block_role_permissions' => array( + 'indexes' => array( + 'block_key' => array('column' => array('block_key', 'permission', 'roles_room_id', 'value', 'id'), 'unique' => 0), + ), + ), + ), + ), + 'down' => array( + 'alter_field' => array( + 'block_role_permissions' => array( + 'block_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + ), + ), + 'drop_field' => array( + 'block_role_permissions' => array('indexes' => array('block_key')), + ), + ), + ); + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + return true; + } +} diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php index f916792..5c7c9e6 100644 --- a/Config/Schema/schema.php +++ b/Config/Schema/schema.php @@ -53,7 +53,7 @@ public function after($event = array()) { public $block_role_permissions = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), 'roles_room_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'index'), - 'block_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), + 'block_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'permission' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'パーミッション e.g.) content_creatable, post_top_article', 'charset' => 'utf8'), 'value' => array('type' => 'boolean', 'null' => false, 'default' => null), 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), @@ -62,7 +62,8 @@ public function after($event = array()) { 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), 'indexes' => array( 'PRIMARY' => array('column' => 'id', 'unique' => 1), - 'roles_room_id' => array('column' => array('roles_room_id', 'block_key'), 'unique' => 0) + 'roles_room_id' => array('column' => array('roles_room_id', 'block_key'), 'unique' => 0), + 'block_key' => array('column' => array('block_key', 'permission', 'roles_room_id', 'value', 'id'), 'unique' => 0) ), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') ); From 806ffadd6f71c56c8703b7c3cfbbc435312ae7e2 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 5 Mar 2019 12:52:59 +0900 Subject: [PATCH 05/40] =?UTF-8?q?Current::$current=E3=82=92=E7=9B=B4?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=81=A8?= =?UTF-8?q?=E3=81=93=E3=82=8D=E3=82=92=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/BlockBehavior.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Behavior/BlockBehavior.php b/Model/Behavior/BlockBehavior.php index f765ab8..f72be1d 100644 --- a/Model/Behavior/BlockBehavior.php +++ b/Model/Behavior/BlockBehavior.php @@ -273,7 +273,7 @@ private function __saveBlock(Model $model, $frame) { } $model->data['BlocksLanguage']['block_id'] = $block['Block']['id']; $model->data['Block'] = $block['Block']; - Current::$current['Block'] = $block['Block']; + Current::write('Block', $block['Block']); //blocks_languagesの登録 if ($model->BlocksLanguage->isM17nGeneralPlugin()) { @@ -307,7 +307,7 @@ private function __saveBlock(Model $model, $frame) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); } $model->data['BlocksLanguage'] = $blockLanguage['BlocksLanguage']; - Current::$current['BlocksLanguage'] = $blockLanguage['BlocksLanguage']; + Current::write('BlocksLanguage', $blockLanguage['BlocksLanguage']); //Behaviorをセットしているモデルに対してblock_idとblock_keyをセットする if ($model->hasField('block_id') && ! Hash::check($model->data, $model->alias . '.block_id')) { From 6a61e53d18357c0d9a582fc8a97d1b3a78d3c877 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 9 Mar 2019 19:02:25 +0900 Subject: [PATCH 06/40] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=80=82URL=E3=81=AB=E5=90=AB=E3=81=BE=E3=82=8C?= =?UTF-8?q?=E3=82=8Bblock=5Fid=E3=81=AB=E4=B8=8D=E5=82=99=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=81=A3=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestSuite/BlocksControllerEditTest.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/TestSuite/BlocksControllerEditTest.php b/TestSuite/BlocksControllerEditTest.php index 0086ac6..94b70ea 100644 --- a/TestSuite/BlocksControllerEditTest.php +++ b/TestSuite/BlocksControllerEditTest.php @@ -209,7 +209,7 @@ public function testEdit($method, $data = null, $validationError = false) { TestAuthGeneral::login($this); $frameId = '6'; - $blockId = '4'; + $blockId = '2'; $roomId = '2'; if ($validationError) { $data = Hash::remove($data, $validationError['field']); @@ -224,11 +224,20 @@ public function testEdit($method, $data = null, $validationError = false) { 'frame_id' => $frameId, 'block_id' => $blockId )); + $deleteUrl = NetCommonsUrl::actionUrl(array( + 'plugin' => $this->plugin, + 'controller' => $this->_controller, + 'action' => 'delete', + 'frame_id' => $frameId, + 'block_id' => $blockId + )); + $params = array( 'method' => $method, 'return' => 'view', 'data' => $data ); + $this->testAction($url, $params); //チェック @@ -239,14 +248,6 @@ public function testEdit($method, $data = null, $validationError = false) { ); } else { //削除フォームの確認 - $deleteUrl = NetCommonsUrl::actionUrl(array( - 'plugin' => $this->plugin, - 'controller' => $this->_controller, - 'action' => 'delete', - 'frame_id' => $frameId, - 'block_id' => $blockId - )); - $asserts = array( array( 'method' => 'assertInput', 'type' => 'form', @@ -304,7 +305,7 @@ public function testDelete($data) { TestAuthGeneral::login($this); $frameId = '6'; - $blockId = '4'; + $blockId = '2'; //アクション実行 $url = NetCommonsUrl::actionUrl(array( From 1a05e76a3451a1094025d589b1b20c2094c39c9e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 10 Mar 2019 07:32:26 +0900 Subject: [PATCH 07/40] =?UTF-8?q?phpunit=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestEditGetTest.php | 8 ++--- .../TestEditPostTest.php | 4 +-- .../DataProviderRoleAccessTest.php | 32 +++++++++---------- .../BlocksControllerEditTest/TestEditTest.php | 6 ++-- .../View/Helper/BlockTabsHelper/BlockTest.php | 21 +++++++----- .../View/Helper/BlockTabsHelper/MainTest.php | 7 ++-- ...BlockRolePermissionsControllerEditTest.php | 4 +-- TestSuite/BlocksControllerEditTest.php | 2 +- View/Helper/BlockTabsHelper.php | 8 ++++- 9 files changed, 53 insertions(+), 39 deletions(-) diff --git a/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditGetTest.php b/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditGetTest.php index da29d85..e85eb7d 100644 --- a/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditGetTest.php +++ b/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditGetTest.php @@ -71,10 +71,10 @@ public function testTestEditGet() { $expected = array( 0 => array(array( 'method' => 'assertInput', 'type' => 'form', 'name' => null, - 'value' => '/test_blocks/TestSuiteBlockRolePermissionsControllerEditTest/edit/4?frame_id=6' + 'value' => '/test_blocks/TestSuiteBlockRolePermissionsControllerEditTest/edit/2?frame_id=6' )), 1 => array(array( - 'method' => 'assertInput', 'type' => 'input', 'name' => 'data[Block][id]', 'value' => '4' + 'method' => 'assertInput', 'type' => 'input', 'name' => 'data[Block][id]', 'value' => '2' )), 2 => array(array( 'name' => 'data[BlockRolePermission][content_creatable][room_administrator][value]', @@ -163,10 +163,10 @@ public function testTestEditGetWOUseCommentApproval() { $expected = array( 0 => array(array( 'method' => 'assertInput', 'type' => 'form', 'name' => null, - 'value' => '/test_blocks/TestSuiteBlockRolePermissionsControllerEditTest/edit/4?frame_id=6' + 'value' => '/test_blocks/TestSuiteBlockRolePermissionsControllerEditTest/edit/2?frame_id=6' )), 1 => array(array( - 'method' => 'assertInput', 'type' => 'input', 'name' => 'data[Block][id]', 'value' => '4' + 'method' => 'assertInput', 'type' => 'input', 'name' => 'data[Block][id]', 'value' => '2' )), 2 => array(array( 'name' => 'data[BlockRolePermission][content_creatable][room_administrator][value]', diff --git a/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php b/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php index 40ac818..cd5f784 100644 --- a/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php +++ b/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php @@ -69,7 +69,7 @@ public function testTestEditPost() { //チェック $expected = array( - 'Block' => array('id' => '4', 'key' => 'block_2'), + 'Block' => array('id' => '2', 'key' => 'block_2'), 'BlockRolePermission' => array( 'content_creatable' => array( 'general_user' => array( @@ -126,7 +126,7 @@ public function testTestEditPostWOUseCommentApproval() { //チェック $expected = array( - 'Block' => array('id' => '4', 'key' => 'block_2'), + 'Block' => array('id' => '2', 'key' => 'block_2'), 'BlockRolePermission' => array( 'content_creatable' => array( 'general_user' => array( diff --git a/Test/Case/TestSuite/BlocksControllerEditTest/DataProviderRoleAccessTest.php b/Test/Case/TestSuite/BlocksControllerEditTest/DataProviderRoleAccessTest.php index 43bbda9..ff086ae 100644 --- a/Test/Case/TestSuite/BlocksControllerEditTest/DataProviderRoleAccessTest.php +++ b/Test/Case/TestSuite/BlocksControllerEditTest/DataProviderRoleAccessTest.php @@ -58,22 +58,22 @@ public function testDataProviderRoleAccess() { //チェック $expected = array( - array( 'add', 'get', 'edit', 'chief_editor', false), - array( 'add', 'get', 'edit', 'editor', 'ForbiddenException'), - array( 'add', 'get', 'edit', 'general_user', 'ForbiddenException'), - array( 'add', 'get', 'edit', 'visitor', 'ForbiddenException'), - array( 'add', 'get', 'edit', null, 'ForbiddenException'), - array( 'edit', 'get', 'edit', 'chief_editor', false), - array( 'edit', 'get', 'edit', 'editor', 'ForbiddenException'), - array( 'edit', 'get', 'edit', 'general_user', 'ForbiddenException'), - array( 'edit', 'get', 'edit', 'visitor', 'ForbiddenException'), - array( 'edit', 'get', 'edit', null, 'ForbiddenException'), - array( 'delete', 'get', 'delete', 'room_administrator', 'BadRequestException'), - array( 'delete', 'get', 'delete', 'chief_editor', 'BadRequestException'), - array( 'delete', 'get', 'delete', 'editor', 'ForbiddenException'), - array( 'delete', 'get', 'delete', 'general_user', 'ForbiddenException'), - array( 'delete', 'get', 'delete', 'visitor', 'ForbiddenException'), - array( 'delete', 'get', 'delete', null, 'ForbiddenException') + array('add', 'get', 'edit', 'chief_editor', false), + array('add', 'get', 'edit', 'editor', 'ForbiddenException'), + array('add', 'get', 'edit', 'general_user', 'ForbiddenException'), + array('add', 'get', 'edit', 'visitor', 'ForbiddenException'), + array('add', 'get', 'edit', null, 'ForbiddenException'), + array('edit', 'get', 'edit', 'chief_editor', false), + array('edit', 'get', 'edit', 'editor', 'ForbiddenException'), + array('edit', 'get', 'edit', 'general_user', 'ForbiddenException'), + array('edit', 'get', 'edit', 'visitor', 'ForbiddenException'), + array('edit', 'get', 'edit', null, 'ForbiddenException'), + array('delete', 'get', 'delete', 'room_administrator', 'BadRequestException'), + array('delete', 'get', 'delete', 'chief_editor', 'BadRequestException'), + array('delete', 'get', 'delete', 'editor', 'ForbiddenException'), + array('delete', 'get', 'delete', 'general_user', 'ForbiddenException'), + array('delete', 'get', 'delete', 'visitor', 'ForbiddenException'), + array('delete', 'get', 'delete', null, 'ForbiddenException') ); $this->assertEquals($expected, $result); } diff --git a/Test/Case/TestSuite/BlocksControllerEditTest/TestEditTest.php b/Test/Case/TestSuite/BlocksControllerEditTest/TestEditTest.php index 9fd8135..36a4897 100644 --- a/Test/Case/TestSuite/BlocksControllerEditTest/TestEditTest.php +++ b/Test/Case/TestSuite/BlocksControllerEditTest/TestEditTest.php @@ -78,7 +78,7 @@ private function __expectedByGet() { 'method' => 'assertInput', 'type' => 'form', 'name' => null, - 'value' => '/test_blocks/TestSuiteBlocksControllerEditTest/edit/4?frame_id=6' + 'value' => '/test_blocks/TestSuiteBlocksControllerEditTest/edit/2?frame_id=6' ), 1 => array( 'method' => 'assertInput', @@ -90,7 +90,7 @@ private function __expectedByGet() { 'method' => 'assertInput', 'type' => 'input', 'name' => 'data[Block][id]', - 'value' => '4' + 'value' => '2' ), 3 => array( 'method' => 'assertInput', @@ -102,7 +102,7 @@ private function __expectedByGet() { 'method' => 'assertInput', 'type' => 'form', 'name' => null, - 'value' => '/test_blocks/TestSuiteBlocksControllerEditTest/delete/4?frame_id=6' + 'value' => '/test_blocks/TestSuiteBlocksControllerEditTest/delete/2' ), 5 => array( 'method' => 'assertInput', diff --git a/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php b/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php index e442cfa..e95079f 100644 --- a/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php +++ b/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php @@ -113,10 +113,10 @@ private function __getViewVars() { public function dataProvider() { return array( array('activeTab' => 'block_settings', 'blockPermission' => true), - array('activeTab' => 'mail_settings', 'blockPermission' => true), - array('activeTab' => 'role_permissions', 'blockPermission' => true), - array('activeTab' => 'role_permissions', 'blockPermission' => false), - array('activeTab' => 'original', 'blockPermission' => true), +// array('activeTab' => 'mail_settings', 'blockPermission' => true), +// array('activeTab' => 'role_permissions', 'blockPermission' => true), +// array('activeTab' => 'role_permissions', 'blockPermission' => false), +// array('activeTab' => 'original', 'blockPermission' => true), ); } @@ -136,8 +136,11 @@ public function testBlock($activeTab, $blockPermission) { $this->loadHelper('Blocks.BlockTabs', $viewVars, $requestData, $params); //データ生成 - Current::$current['Permission']['block_editable']['value'] = true; - Current::$current['Permission']['block_permission_editable']['value'] = $blockPermission; + Current::write('Frame.id', '6'); + Current::write('Room.id', '2'); + //Current::write('Block.id', '2'); + Current::writePermission('2', 'block_editable', true); + Current::writePermission('2', 'block_permission_editable', $blockPermission); //テスト実施 $result = $this->BlockTabs->block($activeTab); @@ -174,8 +177,10 @@ public function testBlockAdd() { //データ生成 $activeTab = 'block_settings'; - Current::$current['Permission']['block_editable']['value'] = true; - Current::$current['Permission']['block_permission_editable']['value'] = true; + Current::write('Frame.id', '6'); + Current::write('Room.id', '2'); + Current::writePermission('2', 'block_editable', true); + Current::writePermission('2', 'block_permission_editable', true); //テスト実施 $result = $this->BlockTabs->block($activeTab); diff --git a/Test/Case/View/Helper/BlockTabsHelper/MainTest.php b/Test/Case/View/Helper/BlockTabsHelper/MainTest.php index 6935606..723cbea 100644 --- a/Test/Case/View/Helper/BlockTabsHelper/MainTest.php +++ b/Test/Case/View/Helper/BlockTabsHelper/MainTest.php @@ -145,8 +145,11 @@ public function testMain($activeTab, $blockPermission) { $this->loadHelper('Blocks.BlockTabs', $viewVars, $requestData, $params); //データ生成 - Current::$current['Permission']['block_editable']['value'] = true; - Current::$current['Permission']['block_permission_editable']['value'] = $blockPermission; + Current::write('Frame.id', '6'); + Current::write('Room.id', '2'); + //Current::write('Block.id', '2'); + Current::writePermission('2', 'block_editable', true); + Current::writePermission('2', 'block_permission_editable', $blockPermission); //テスト実施 $result = $this->BlockTabs->main($activeTab); diff --git a/TestSuite/BlockRolePermissionsControllerEditTest.php b/TestSuite/BlockRolePermissionsControllerEditTest.php index 097ed66..98b2fb3 100644 --- a/TestSuite/BlockRolePermissionsControllerEditTest.php +++ b/TestSuite/BlockRolePermissionsControllerEditTest.php @@ -207,7 +207,7 @@ public function testEditGet($approvalFields, $exception = null, $return = 'view' TestAuthGeneral::login($this); $frameId = '6'; - $blockId = '4'; + $blockId = '2'; //テスト実施 $url = array( @@ -260,7 +260,7 @@ public function testEditPost($data, $exception = null, $return = 'view') { TestAuthGeneral::login($this); $frameId = '6'; - $blockId = '4'; + $blockId = '2'; $blockKey = 'block_2'; $roomId = '2'; $permissions = $this->_getPermissionData(true, Hash::check($data, '{s}.use_comment_approval')); diff --git a/TestSuite/BlocksControllerEditTest.php b/TestSuite/BlocksControllerEditTest.php index 94b70ea..019a8b4 100644 --- a/TestSuite/BlocksControllerEditTest.php +++ b/TestSuite/BlocksControllerEditTest.php @@ -228,7 +228,7 @@ public function testEdit($method, $data = null, $validationError = false) { 'plugin' => $this->plugin, 'controller' => $this->_controller, 'action' => 'delete', - 'frame_id' => $frameId, + //'frame_id' => $frameId, 'block_id' => $blockId )); diff --git a/View/Helper/BlockTabsHelper.php b/View/Helper/BlockTabsHelper.php index 8a23539..29d008f 100644 --- a/View/Helper/BlockTabsHelper.php +++ b/View/Helper/BlockTabsHelper.php @@ -394,7 +394,13 @@ private function __listTag($activeTab, $key, $tab) { $activeTabCss = ''; } - if (Current::permission(Hash::get($tab, 'permission', 'block_editable'))) { + if (isset($tab['permission'])) { + if (Current::permission($tab['permission'])) { + $html .= '
  • '; + $html .= $this->NetCommonsHtml->link(__d($tab['label'][0], $tab['label'][1]), $tab['url']); + $html .= '
  • '; + } + } elseif (Current::permission('block_editable')) { $html .= '
  • '; $html .= $this->NetCommonsHtml->link(__d($tab['label'][0], $tab['label'][1]), $tab['url']); $html .= '
  • '; From 115d89adf806246e314079fab39b20afca100b75 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 10 Mar 2019 09:26:11 +0900 Subject: [PATCH 08/40] =?UTF-8?q?phpunit=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestSuite/BlockRolePermissionsControllerEditTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestSuite/BlockRolePermissionsControllerEditTest.php b/TestSuite/BlockRolePermissionsControllerEditTest.php index 98b2fb3..16d12f3 100644 --- a/TestSuite/BlockRolePermissionsControllerEditTest.php +++ b/TestSuite/BlockRolePermissionsControllerEditTest.php @@ -261,7 +261,7 @@ public function testEditPost($data, $exception = null, $return = 'view') { $frameId = '6'; $blockId = '2'; - $blockKey = 'block_2'; + $blockKey = 'block_1'; $roomId = '2'; $permissions = $this->_getPermissionData(true, Hash::check($data, '{s}.use_comment_approval')); From ec2edf0ea9172b088cc60a81d923541d0861d3d3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 10 Mar 2019 11:05:51 +0900 Subject: [PATCH 09/40] =?UTF-8?q?phpcs=E3=82=A8=E3=83=A9=E3=83=BC=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test/Case/View/Helper/BlockTabsHelper/BlockTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php b/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php index e95079f..573c008 100644 --- a/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php +++ b/Test/Case/View/Helper/BlockTabsHelper/BlockTest.php @@ -113,10 +113,10 @@ private function __getViewVars() { public function dataProvider() { return array( array('activeTab' => 'block_settings', 'blockPermission' => true), -// array('activeTab' => 'mail_settings', 'blockPermission' => true), -// array('activeTab' => 'role_permissions', 'blockPermission' => true), -// array('activeTab' => 'role_permissions', 'blockPermission' => false), -// array('activeTab' => 'original', 'blockPermission' => true), + array('activeTab' => 'mail_settings', 'blockPermission' => true), + array('activeTab' => 'role_permissions', 'blockPermission' => true), + array('activeTab' => 'role_permissions', 'blockPermission' => false), + array('activeTab' => 'original', 'blockPermission' => true), ); } From f6b5ea8b024e9cfd1c27ac01bfd88891bc74600e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 10 Mar 2019 11:17:42 +0900 Subject: [PATCH 10/40] =?UTF-8?q?phpunit=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestEditPostTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php b/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php index cd5f784..2616574 100644 --- a/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php +++ b/Test/Case/TestSuite/BlockRolePermissionsControllerEditTest/TestEditPostTest.php @@ -69,31 +69,31 @@ public function testTestEditPost() { //チェック $expected = array( - 'Block' => array('id' => '2', 'key' => 'block_2'), + 'Block' => array('id' => '2', 'key' => 'block_1'), 'BlockRolePermission' => array( 'content_creatable' => array( 'general_user' => array( - 'roles_room_id' => '4', 'block_key' => 'block_2', + 'roles_room_id' => '4', 'block_key' => 'block_1', 'permission' => 'content_creatable', 'value' => '1' ) ), 'content_comment_creatable' => array( 'editor' => array( - 'roles_room_id' => '3', 'block_key' => 'block_2', + 'roles_room_id' => '3', 'block_key' => 'block_1', 'permission' => 'content_comment_creatable', 'value' => '1' ), 'general_user' => array( - 'roles_room_id' => '4', 'block_key' => 'block_2', + 'roles_room_id' => '4', 'block_key' => 'block_1', 'permission' => 'content_comment_creatable', 'value' => '1' ), 'visitor' => array( - 'roles_room_id' => '5', 'block_key' => 'block_2', + 'roles_room_id' => '5', 'block_key' => 'block_1', 'permission' => 'content_comment_creatable', 'value' => '1' ) ), 'content_comment_publishable' => array( 'editor' => array( - 'roles_room_id' => '3', 'block_key' => 'block_2', + 'roles_room_id' => '3', 'block_key' => 'block_1', 'permission' => 'content_comment_publishable', 'value' => '1' ) ) @@ -126,11 +126,11 @@ public function testTestEditPostWOUseCommentApproval() { //チェック $expected = array( - 'Block' => array('id' => '2', 'key' => 'block_2'), + 'Block' => array('id' => '2', 'key' => 'block_1'), 'BlockRolePermission' => array( 'content_creatable' => array( 'general_user' => array( - 'roles_room_id' => '4', 'block_key' => 'block_2', + 'roles_room_id' => '4', 'block_key' => 'block_1', 'permission' => 'content_creatable', 'value' => '1' ) ), From 41a2ef185dc2e90d1f25dc7f94787e846b0d8d27 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 9 May 2019 11:22:52 +0900 Subject: [PATCH 11/40] =?UTF-8?q?change:=20beforeValidate()=E3=82=92?= =?UTF-8?q?=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=99=E3=81=9F=E3=81=B3=E3=81=AB?= =?UTF-8?q?Hash::merge=E3=81=A7=E3=83=90=E3=83=AA=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=AB=E3=83=BC=E3=83=AB=E3=81=8C?= =?UTF-8?q?=E5=A2=97=E3=81=88=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82ValidateM?= =?UTF-8?q?erge::merge=E3=81=B8=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88?= =?UTF-8?q?=E3=81=9F=20Refs=20https://github.com/NetCommons3/NetCommons3/i?= =?UTF-8?q?ssues/1486?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/BlockSettingBehavior.php | 2 +- Model/Block.php | 2 +- Model/BlockRolePermission.php | 2 +- Model/BlockSetting.php | 2 +- Model/BlocksLanguage.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Model/Behavior/BlockSettingBehavior.php b/Model/Behavior/BlockSettingBehavior.php index d4248e4..9534a8b 100644 --- a/Model/Behavior/BlockSettingBehavior.php +++ b/Model/Behavior/BlockSettingBehavior.php @@ -505,7 +505,7 @@ public function validateBlockSetting(Model $model, $blockKey = null) { if (array_key_exists($field, $inputData)) { // validate追加 $rule = $blockSetting['BlockSetting'][$field]['type']; - $model->validate = Hash::merge($model->validate, array( + $model->validate = ValidateMerge::merge($model->validate, array( $field => array( $rule => array( 'rule' => $rule, diff --git a/Model/Block.php b/Model/Block.php index 3105629..4fca8c8 100644 --- a/Model/Block.php +++ b/Model/Block.php @@ -211,7 +211,7 @@ public function bindModelBlockLang($joinKey = 'Block.id') { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge(array( + $this->validate = ValidateMerge::merge(array( 'room_id' => array( 'numeric' => array( 'rule' => array('numeric'), diff --git a/Model/BlockRolePermission.php b/Model/BlockRolePermission.php index 59c107c..fe22555 100644 --- a/Model/BlockRolePermission.php +++ b/Model/BlockRolePermission.php @@ -67,7 +67,7 @@ class BlockRolePermission extends BlocksAppModel { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge($this->validate, array( + $this->validate = ValidateMerge::merge($this->validate, array( 'roles_room_id' => array( 'numeric' => array( 'rule' => array('numeric'), diff --git a/Model/BlockSetting.php b/Model/BlockSetting.php index b4a9238..6286552 100644 --- a/Model/BlockSetting.php +++ b/Model/BlockSetting.php @@ -34,7 +34,7 @@ class BlockSetting extends BlocksAppModel { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge($this->validate, array( + $this->validate = ValidateMerge::merge($this->validate, array( 'plugin_key' => array( 'notBlank' => array( 'rule' => array('notBlank'), diff --git a/Model/BlocksLanguage.php b/Model/BlocksLanguage.php index e4be711..429b5e5 100644 --- a/Model/BlocksLanguage.php +++ b/Model/BlocksLanguage.php @@ -75,7 +75,7 @@ class BlocksLanguage extends BlocksAppModel { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge(array( + $this->validate = ValidateMerge::merge(array( 'language_id' => array( 'numeric' => array( 'rule' => array('numeric'), From fa98f37598265ca5f5c29a97e64f971ff090bcb0 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Tue, 14 May 2019 10:05:43 +0900 Subject: [PATCH 12/40] =?UTF-8?q?add:=20=E7=A7=BB=E8=A1=8C=E3=83=84?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=A7=E3=82=AF=E3=82=A8=E3=83=AA=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E3=81=AB=E6=99=82=E9=96=93=E3=81=AE=E3=81=8B=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=82=8B=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB?= =?UTF-8?q?=E3=81=ABindex=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1557795495_add_index_for_block_setting.php | 70 +++++++++++++++++++ Config/Schema/schema.php | 5 +- 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 Config/Migration/1557795495_add_index_for_block_setting.php diff --git a/Config/Migration/1557795495_add_index_for_block_setting.php b/Config/Migration/1557795495_add_index_for_block_setting.php new file mode 100644 index 0000000..b966579 --- /dev/null +++ b/Config/Migration/1557795495_add_index_for_block_setting.php @@ -0,0 +1,70 @@ + array( + 'alter_field' => array( + 'block_settings' => array( + 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'key' => 'index'), + ), + ), + 'create_field' => array( + 'block_settings' => array( + 'indexes' => array( + 'room_id' => array('column' => 'room_id', 'unique' => 0), + ), + ), + ), + ), + 'down' => array( + 'alter_field' => array( + 'block_settings' => array( + 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), + ), + ), + 'drop_field' => array( + 'block_settings' => array('indexes' => array('room_id')), + ), + ), + ); + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + return true; + } +} diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php index 5c7c9e6..8a7bd1c 100644 --- a/Config/Schema/schema.php +++ b/Config/Schema/schema.php @@ -76,7 +76,7 @@ public function after($event = array()) { public $block_settings = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), 'plugin_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), + 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'key' => 'index'), 'block_key' => array('type' => 'string', 'null' => true, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'field_name' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), 'value' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), @@ -88,7 +88,8 @@ public function after($event = array()) { 'indexes' => array( 'PRIMARY' => array('column' => 'id', 'unique' => 1), 'plugin_key' => array('column' => array('plugin_key', 'room_id', 'block_key', 'field_name'), 'unique' => 0), - 'block_key' => array('column' => array('block_key', 'field_name', 'room_id', 'plugin_key', 'value'), 'unique' => 0) + 'block_key' => array('column' => array('block_key', 'field_name', 'room_id', 'plugin_key', 'value'), 'unique' => 0), + 'room_id' => array('column' => 'room_id', 'unique' => 0) ), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') ); From 5baec0edb8b4dfa27f3374764d8a0d8c8415508b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 12 Jul 2019 12:07:42 +0900 Subject: [PATCH 13/40] =?UTF-8?q?fix:=20utf8mb4=20+=20MySQL5.7=E3=81=AE?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=80=81=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=80=82=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/286?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Migration/1551245049_improve_performance_current.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Migration/1551245049_improve_performance_current.php b/Config/Migration/1551245049_improve_performance_current.php index 94aa4e4..b00501f 100644 --- a/Config/Migration/1551245049_improve_performance_current.php +++ b/Config/Migration/1551245049_improve_performance_current.php @@ -40,7 +40,7 @@ class ImprovePerformanceCurrent extends NetCommonsMigration { 'create_field' => array( 'block_settings' => array( 'indexes' => array( - 'block_key' => array('column' => array('block_key', 'field_name', 'room_id', 'plugin_key', 'value'), 'unique' => 0), + 'block_key' => array('column' => array('`block_key`(191)', '`field_name`(191)', 'room_id', '`plugin_key`(191)', '`value`(191)'), 'unique' => 0), ), ), ), From 0005c8d4590da41c3229ee16b24a9af54a5a83dd Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 25 Jul 2019 15:56:12 +0900 Subject: [PATCH 14/40] =?UTF-8?q?change:=20test:=20schema=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8B=E3=82=89=E3=83=86=E3=83=BC?= =?UTF-8?q?=E3=83=96=E3=83=AB=E6=A7=8B=E6=88=90=E3=82=92=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test/Fixture/BlockSettingFixture.php | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/Test/Fixture/BlockSettingFixture.php b/Test/Fixture/BlockSettingFixture.php index ef3f752..6463f68 100644 --- a/Test/Fixture/BlockSettingFixture.php +++ b/Test/Fixture/BlockSettingFixture.php @@ -23,29 +23,6 @@ class BlockSettingFixture extends CakeTestFixture { */ public $pluginKey = 'dummy'; -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), - 'plugin_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'), - 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'block_key' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'), - 'field_name' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'), - 'value' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'), - 'type' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8mb4', 'collate' => 'utf8mb4_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -232,6 +209,8 @@ class BlockSettingFixture extends CakeTestFixture { * @return void */ public function init() { + require_once App::pluginPath('Blocks') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new BlocksSchema())->tables['block_settings']; parent::init(); // 継承先で $this->pluginKey を上書きすれば、そのプラグインに対応したデータになるので From 74b0904bbd006eb1dc67f2016bf203f5cca65755 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 4 Aug 2019 22:24:18 +0900 Subject: [PATCH 15/40] =?UTF-8?q?add:=20test:=20travis=20php7.2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index be7cc85..b740082 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,10 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 sudo: false +dist: trusty env: matrix: From d943e3f29e14b3b0a2637a22fe1f5f05159cce31 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 7 Aug 2019 21:45:40 +0900 Subject: [PATCH 16/40] =?UTF-8?q?fix:=20test:=20travis=20php7.2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 09f2627..80c2d3e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,5 @@ - From e78fa563fb6f9aae04d0b231fcd5bc44498a5445 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 10 Aug 2019 19:23:08 +0900 Subject: [PATCH 17/40] =?UTF-8?q?fix:=20test:=20TestSuite=E3=82=92?= =?UTF-8?q?=E3=82=A2=E3=83=BC=E3=82=AB=E3=82=A4=E3=83=96=E3=81=AB=E5=90=AB?= =?UTF-8?q?=E3=82=81=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?475?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 8764193..2cbbe11 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ # Remove files for archives generated using `git archive` Test export-ignore +TestSuite export-ignore .gitattributes export-ignore .travis.yml export-ignore phpunit.xml.dist export-ignore From 7a57235eaa176f71002866c30b61aed1f138dedb Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 10 Aug 2019 19:27:32 +0900 Subject: [PATCH 18/40] =?UTF-8?q?revert:=20test:=20=E5=85=83=E3=81=AB?= =?UTF-8?q?=E6=88=BB=E3=81=99=E3=80=82=20=E5=BD=93=E3=83=97=E3=83=A9?= =?UTF-8?q?=E3=82=B0=E3=82=A4=E3=83=B3=E3=81=AFstable=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=80=81=E5=88=A5=E3=81=AE=E3=83=97=E3=83=A9=E3=82=B0?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=92=E9=96=8B=E7=99=BA=E4=B8=AD=E3=81=A0?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=82=8A=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E3=83=86=E3=82=B9=E3=83=88=E3=81=8C=E5=8B=95=E3=81=8B?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B=E3=81=9F=E3=82=81=E3=80=82?= =?UTF-8?q?=20https://github.com/NetCommons3/NetCommons3/issues/1475?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2cbbe11..8764193 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,5 @@ # Remove files for archives generated using `git archive` Test export-ignore -TestSuite export-ignore .gitattributes export-ignore .travis.yml export-ignore phpunit.xml.dist export-ignore From 9d911afaa4a624d27442d70dfda3c1699e954e69 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 29 Oct 2019 18:03:20 +0900 Subject: [PATCH 19/40] =?UTF-8?q?fix:=20ForbiddenException=E3=81=A7?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E7=9C=81?= =?UTF-8?q?=E7=95=A5=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=80=8C=E3=81=93=E3=81=AE=E3=82=A2=E3=82=AB=E3=82=A6=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=A7=E3=81=AF=E3=80=81=E3=83=BB=E3=83=BB=E3=83=BB?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=20https://github.com/researchmap/Rm?= =?UTF-8?q?NetCommons3/issues/1444?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/TestSuiteBlocksControllerTestErrorController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/test_app/Plugin/TestBlocks/Controller/TestSuiteBlocksControllerTestErrorController.php b/Test/test_app/Plugin/TestBlocks/Controller/TestSuiteBlocksControllerTestErrorController.php index d536c80..7404a2a 100644 --- a/Test/test_app/Plugin/TestBlocks/Controller/TestSuiteBlocksControllerTestErrorController.php +++ b/Test/test_app/Plugin/TestBlocks/Controller/TestSuiteBlocksControllerTestErrorController.php @@ -27,7 +27,7 @@ class TestSuiteBlocksControllerTestErrorController extends AppController { */ public function index() { $this->autoRender = true; - throw new ForbiddenException(__d('net_commons', 'Permission denied')); + throw new ForbiddenException(); } } From e186b3e7d55b4c3d5410957be3e5ae0c6c64d5ae Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Mar 2020 07:16:58 +0900 Subject: [PATCH 20/40] =?UTF-8?q?change:=20test:=20travis.yml=E3=81=8B?= =?UTF-8?q?=E3=82=89php5.4,5.5=E3=82=92=E5=89=8A=E9=99=A4=E3=80=82php7.3,7?= =?UTF-8?q?.4=E3=82=92=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/?= =?UTF-8?q?NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b740082..97859a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 sudo: false dist: trusty From 463adb68a8d4b5b5b8214a7a707e2b653a1abf69 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Mar 2020 13:20:45 +0900 Subject: [PATCH 21/40] =?UTF-8?q?fix:=20Block=E3=83=A2=E3=83=87=E3=83=AB?= =?UTF-8?q?=E5=86=85=E3=81=AE$this->id=E5=A4=89=E6=95=B0=E3=81=AE=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=8C=96=E3=82=92=E3=81=97=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=9F=E3=82=81=E3=80=81RSS?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=83=80=E3=82=92=E5=90=8C=E3=81=98=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AB=E9=85=8D=E7=BD=AE=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=A8Notice=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=20?= =?UTF-8?q?=E2=80=BB=E5=8E=B3=E5=AF=86=E3=81=AB=E3=81=AF=E3=80=81=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E3=83=9A=E3=83=BC=E3=82=B8=E5=86=85=E3=81=A7=E6=96=B0?= =?UTF-8?q?=E3=81=97=E3=81=84BlockBehavior=E3=81=AEbeforeSave=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=81=8C=E5=8B=95=E3=81=8F=E3=81=A8=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=80=82=E8=AA=BF=E6=9F=BB=E3=81=97=E3=81=9F?= =?UTF-8?q?=E7=AF=84=E5=9B=B2=E3=81=A7=E3=81=AF=E3=80=81RSS=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=83=80=E3=81=AE=E3=81=BF=E3=80=82=20https://github.?= =?UTF-8?q?com/researchmap/RmNetCommons3/issues/1781?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/BlockBehavior.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Model/Behavior/BlockBehavior.php b/Model/Behavior/BlockBehavior.php index f72be1d..5e85191 100644 --- a/Model/Behavior/BlockBehavior.php +++ b/Model/Behavior/BlockBehavior.php @@ -267,6 +267,7 @@ private function __saveBlock(Model $model, $frame) { $model->data['Block']['plugin_key'] = Inflector::underscore($model->plugin); //blocksの登録 + $model->Block->create(); $block = $model->Block->save($model->data['Block'], false); if (! $block) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); @@ -302,6 +303,7 @@ private function __saveBlock(Model $model, $frame) { ); $model->data['BlocksLanguage'] = Hash::insert($model->data['BlocksLanguage'], 'modified', null); + $model->BlocksLanguage->create(); $blockLanguage = $model->BlocksLanguage->save($model->data['BlocksLanguage'], false); if (! $blockLanguage) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); From da18ae0a67b45cd141e8a31318a2d066377c5d61 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Mar 2020 13:37:56 +0900 Subject: [PATCH 22/40] =?UTF-8?q?fix:=20=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88?= =?UTF-8?q?=E5=80=A4=E3=81=8C=E3=82=BB=E3=83=83=E3=83=88=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20https://github.com/researchmap/RmNetCommons3/issues/1781?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/BlockBehavior.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Behavior/BlockBehavior.php b/Model/Behavior/BlockBehavior.php index 5e85191..e949630 100644 --- a/Model/Behavior/BlockBehavior.php +++ b/Model/Behavior/BlockBehavior.php @@ -267,7 +267,7 @@ private function __saveBlock(Model $model, $frame) { $model->data['Block']['plugin_key'] = Inflector::underscore($model->plugin); //blocksの登録 - $model->Block->create(); + $model->Block->create(null); $block = $model->Block->save($model->data['Block'], false); if (! $block) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); @@ -303,7 +303,7 @@ private function __saveBlock(Model $model, $frame) { ); $model->data['BlocksLanguage'] = Hash::insert($model->data['BlocksLanguage'], 'modified', null); - $model->BlocksLanguage->create(); + $model->BlocksLanguage->create(null); $blockLanguage = $model->BlocksLanguage->save($model->data['BlocksLanguage'], false); if (! $blockLanguage) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); From cc3c28180a07bfbe2727c8925b3965ece9d03c33 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 31 Jul 2020 22:30:23 +0900 Subject: [PATCH 23/40] =?UTF-8?q?change:=20test:=20Travis=E3=81=8B?= =?UTF-8?q?=E3=82=89PHP5.6=E3=82=92=E5=89=8A=E9=99=A4,php72=E4=BB=A5?= =?UTF-8?q?=E9=99=8D=E3=81=A7UnitTest=E3=81=A7Warning=E3=81=8C=E5=87=BA?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1588?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 - phpunit.xml.dist | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 97859a3..27ad997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 80c2d3e..7d812ff 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,11 @@ + + + + + + app/Plugin/Blocks From 9b341b00f168ecd6fb09d99b234f45cc65417d37 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 26 Aug 2020 20:16:20 +0900 Subject: [PATCH 24/40] change: Version number to 3.3.2 --- VERSION.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..4772543 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +3.3.2 From fc4fd44f6d70cb287f1adfd0fcd7cd95c2b1bbd6 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 13 Dec 2020 15:44:14 +0900 Subject: [PATCH 25/40] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=AEphp7.3?= =?UTF-8?q?=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 27ad997..40b617d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.0 - 7.1 - 7.2 - - 7.3 + - 7.3.24 - 7.4 sudo: false From fa2ca1fddf58601c7ded7138ff7e46ee709ec00d Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:51:33 +0900 Subject: [PATCH 26/40] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From d2e7ca19382d47f1c444b837038f0f2b256a188b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:51:38 +0900 Subject: [PATCH 27/40] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From 6f0f4bd34fcc26e5041d52ca1b83ac70a7595f58 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 30 Jul 2021 15:05:44 +0900 Subject: [PATCH 28/40] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 12 ++-- phpunit.xml.dist | 4 +- 4 files changed, 143 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - name: docker-compose install + run: | + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh + sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build + + - name: push coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.php }} + run: | + cd ${NC3_BUILD_DIR} + ls -la ${NC3_BUILD_DIR} + vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 40b617d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "hjkDbuIn2kJSKlMFFxzS7FuwGDqgVTPNoqjyN8WH0IiDi+CLMEqzQQ+gLvGEBvjcmjmD+Zv1G/bjmL+CE2G/UaDf6iH0sGBZEo9yWB5eyAnsTjeZ39lEz/I3pllUhmhMC2y9ykkhPhlTiHSeBFrzWXAm7TTUi5VCgMthaHbjnvs=" - - GIT_COMMITTER_NAME=s-nakajima - - GIT_COMMITTER_EMAIL=nakajimashouhei@gmail.com - - GIT_AUTHOR_NAME=s-nakajima - - GIT_AUTHOR_EMAIL=nakajimashouhei@gmail.com - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index c026250..d1ebad8 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,15 @@ Blocks ============== + +[![Tests Status](https://github.com/NetCommons3/Blocks/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/Blocks/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/Blocks/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/Blocks?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/blocks.svg?label=stable)](https://packagist.org/packages/netcommons/blocks) + NetCommonsのブロックとは、フレームに割り当てるデータ概念です。
    フレームに配置されるプラグインは、1つ以上のブロックを持ち1ブロックにたいして、複数のコンテンツが関連付けられます。
    フレームの右上部Glyphicon(歯車)をクリックすると表示されるブロック設定画面の共通処理をまとめています。 -[![Build Status](https://api.travis-ci.org/NetCommons3/Blocks.png?branch=master)](https://travis-ci.org/NetCommons3/Blocks) -[![Coverage Status](https://coveralls.io/repos/NetCommons3/Blocks/badge.png?branch=master)](https://coveralls.io/r/NetCommons3/Blocks?branch=master) - -| dependencies | status | -| ------------- | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/543b99c1b2a9c5db88000385/badge.png)](https://www.versioneye.com/user/projects/543b99c1b2a9c5db88000385) | - ### BlockTabsComponent なくなる予定
    diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7d812ff..efe4f75 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/Blocks @@ -20,5 +17,6 @@ +
    From 8c666f1b68b67335f6cc0c2bb3405e7c9e8d7499 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 30 Jul 2021 15:35:16 +0900 Subject: [PATCH 29/40] =?UTF-8?q?change:=20test:=20phpunit.xml=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index efe4f75..804c874 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -17,6 +17,6 @@ - + From 09a2853e8a77ae024e8c2d1f18f834353f7c4e3c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Aug 2021 22:04:18 +0900 Subject: [PATCH 30/40] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From 79faef13255ae94341c13c3d54d35a5561438134 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 14:35:10 +0900 Subject: [PATCH 31/40] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From f427d0235b3960206e5ed01e9443e7a110a78e38 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 18 Oct 2021 10:03:45 +0900 Subject: [PATCH 32/40] =?UTF-8?q?change:=20=E7=99=BB=E9=8C=B2=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=A0=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=A0=E6=8A=95=E7=A8=BF=E3=81=AE=E9=80=9A=E7=9F=A5=E3=82=92?= =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=A0=E7=AE=A1=E7=90=86=E3=81=AB=E3=81=AF?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=81=9B=E3=81=9A=E3=81=AB=E6=9C=AC=E4=BA=BA?= =?UTF-8?q?=E3=81=AE=E3=81=BF=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20https:?= =?UTF-8?q?//github.com/NetCommons3/NetCommons3/issues/1669?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webroot/js/block_role_permissions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webroot/js/block_role_permissions.js b/webroot/js/block_role_permissions.js index 38f3af8..5fe443a 100644 --- a/webroot/js/block_role_permissions.js +++ b/webroot/js/block_role_permissions.js @@ -88,13 +88,13 @@ NetCommonsApp.controller('BlockRolePermissions', ['$scope', function($scope) { '[value]"]'); if (! $event.currentTarget.checked) { - if (baseRole['level'] > role['level']) { + if (Number(baseRole['level']) > Number(role['level'])) { if (! angular.isUndefined(element[0]) && ! element[0].disabled) { element[0].checked = false; } } } else { - if (baseRole['level'] < role['level']) { + if (Number(baseRole['level']) < Number(role['level'])) { if (! angular.isUndefined(element[0]) && ! element[0].disabled) { element[0].checked = true; } From cebaaed1187ff72a8407595c77a6f0c38a42ba88 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 13 Nov 2021 15:04:23 +0900 Subject: [PATCH 33/40] comment: Modified release tags. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 592d72f..2542421 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: | - NetCommons ${{ github.ref }} released. + ${{ github.repository }} ${{ github.ref }} released. draft: false prerelease: false From 9edd4d4011b859ae42430e765f3b7030a0a05827 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 13 Nov 2021 15:06:49 +0900 Subject: [PATCH 34/40] comment: Modified release tags. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2542421..96097ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: | - ${{ github.repository }} ${{ github.ref }} released. + ${{ github.repository }}@${{ github.ref }} released. draft: false prerelease: false From 4a6e111c7d1f3199cef9e4784d33ad85f8d82b1c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 18:07:08 +0900 Subject: [PATCH 35/40] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From b6a9ee002cacf3d4231a70f1eeabaf8514f78739 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 09:19:18 +0900 Subject: [PATCH 36/40] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +61,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From 65312e43784142cfa9ca6373e2ffe768cb5e95fa Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 13:32:15 +0900 Subject: [PATCH 37/40] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9501566..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 From 6a6beaf74d8f9357f1ee350b25296c4599ee107e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 25 Feb 2023 21:02:08 +0900 Subject: [PATCH 38/40] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From 8f14cb07577c3f5e3c6844ae820cb30dcee87f7b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 16:23:05 +0900 Subject: [PATCH 39/40] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..eb2068b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,10 +15,11 @@ name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +29,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +93,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +147,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +156,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From 251670fb280f81ff81ffa0c5813bba57613ce4db Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 15:18:40 +0900 Subject: [PATCH 40/40] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7