From 5b0a150d67e2c07e5eba076ed4c5ba5107e396b8 Mon Sep 17 00:00:00 2001 From: Wataru Nishimoto Date: Thu, 20 Feb 2020 13:53:47 +0900 Subject: [PATCH 1/5] feat: don't invalidate CDN cache when updating Topics model (#116) --- Model/TopicUserStatus.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Model/TopicUserStatus.php b/Model/TopicUserStatus.php index d546e41..588996a 100644 --- a/Model/TopicUserStatus.php +++ b/Model/TopicUserStatus.php @@ -29,6 +29,14 @@ class TopicUserStatus extends TopicsAppModel { */ public $validate = array(); +/** + * invalidateCDN cache + * DB 保存/削除時に CDN のキャッシュを invalidate するか + * + * @var bool + */ + public $invalidateCDN = false; + //The Associations below have been created with all possible keys, those that are not needed can be removed /** From 8f2284f23af970b4a6e220284f6687f210c78dac Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 8 Aug 2020 16:31:23 +0900 Subject: [PATCH 2/5] =?UTF-8?q?change:=20test:=20Travis=E3=81=8B=E3=82=89P?= =?UTF-8?q?HP5.6=E3=82=92=E5=89=8A=E9=99=A4,php72=E4=BB=A5=E9=99=8D?= =?UTF-8?q?=E3=81=A7UnitTest=E3=81=A7Warning=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/1588?= 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 a049e43..5405abf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ sudo: false dist: trusty env: - - NETCOMMONS_VERSION=master DB=mysql + - NETCOMMONS_VERSION=availability DB=mysql before_script: - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 From c60888aec1d0c5c37e2c85ed8b6fc97f4a1667e4 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 25 Jan 2021 13:30:03 +0900 Subject: [PATCH 3/5] =?UTF-8?q?change:=20=E8=A1=A8=E7=A4=BA=E7=A8=AE?= =?UTF-8?q?=E5=88=A5=E3=82=92=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=A7=E5=A4=89=E6=9B=B4=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=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 --- Controller/TopicsController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Controller/TopicsController.php b/Controller/TopicsController.php index 49c2f4a..b00c5d9 100644 --- a/Controller/TopicsController.php +++ b/Controller/TopicsController.php @@ -82,6 +82,13 @@ public function index() { $topicFrameSetting = $this->viewVars['topicFrameSetting']; $displayType = $this->viewVars['topicFrameSetting']['display_type']; + $unitType = isset($this->params['named']['unit_type']) + ? (string)$this->params['named']['unit_type'] + : null; + if (TopicFrameSetting::UNIT_TYPE_NUMBERS === $unitType) { + $topicFrameSetting['unit_type'] = $unitType; + } + $conditions = array(); $days = isset($this->params['named']['days']) From 27b898eec08f6d1372e2a16a5fe513aed6ae9818 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Jan 2021 00:24:39 +0900 Subject: [PATCH 4/5] =?UTF-8?q?change:=20=E6=96=B0=E7=9D=80=E6=83=85?= =?UTF-8?q?=E5=A0=B1=E3=82=92=E6=9C=80=E7=B5=82=E6=9B=B4=E6=96=B0=E6=97=A5?= =?UTF-8?q?=E6=99=82=E3=81=A7=E3=82=BD=E3=83=BC=E3=83=88=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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/TopicsController.php | 11 +++++++++++ Model/Topic.php | 8 +++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Controller/TopicsController.php b/Controller/TopicsController.php index b00c5d9..d6ef0f0 100644 --- a/Controller/TopicsController.php +++ b/Controller/TopicsController.php @@ -178,6 +178,17 @@ private function __getTopics($topicFrameSetting, $conditions) { ? $this->params['named']['status'] : 0; + $sort = isset($this->params['named']['order_by']) + ? (string)$this->params['named']['order_by'] + : null; + if ($sort === 'modified') { + $options['order'] = [ + $this->Topic->alias . '.modified' => 'desc', + $this->Topic->alias . '.publish_start' => 'desc', + $this->Topic->alias . '.id' => 'desc' + ]; + } + $this->Paginator->settings = array( 'Topic' => $this->Topic->getQueryOptions($status, $options), ); diff --git a/Model/Topic.php b/Model/Topic.php index cb9b59b..7280a64 100644 --- a/Model/Topic.php +++ b/Model/Topic.php @@ -498,11 +498,13 @@ public function getQueryOptions($status, $options = array()) { $options['conditions'][] = $statusConditions; } + if (! isset($options['order'])) { + $options['order'] = [ + $this->alias . '.publish_start' => 'desc', $this->alias . '.id' => 'desc' + ]; + } $result = Hash::merge(array( 'recursive' => 0, - 'order' => array( - $this->alias . '.publish_start' => 'desc', $this->alias . '.id' => 'desc' - ), ), $options); return $result; From 56b6eb75016afa9f72db5601edffca6ce74cd498 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 9 Feb 2021 10:22:29 +0900 Subject: [PATCH 5/5] =?UTF-8?q?change:=20test:=20PHPMD=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/TopicsController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Controller/TopicsController.php b/Controller/TopicsController.php index d6ef0f0..c4aa711 100644 --- a/Controller/TopicsController.php +++ b/Controller/TopicsController.php @@ -77,6 +77,7 @@ public function beforeFilter() { * * 速度改善の修正に伴って発生したため抑制 * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function index() { $topicFrameSetting = $this->viewVars['topicFrameSetting'];