From 6e09c692aaaa727cf47fb109c191de1dd932efee Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 8 Nov 2019 08:25:09 +0900 Subject: [PATCH 01/14] =?UTF-8?q?fix:=20=E6=88=BB=E3=82=8A=E5=80=A4?= =?UTF-8?q?=E3=81=AE=E5=9E=8B=E5=AE=A3=E8=A8=80=E3=81=ABvoid=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=97=E3=81=A6=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/TinydbItemsEditController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/TinydbItemsEditController.php b/Controller/TinydbItemsEditController.php index db02348..e227606 100644 --- a/Controller/TinydbItemsEditController.php +++ b/Controller/TinydbItemsEditController.php @@ -261,7 +261,7 @@ public function delete() { * @param $tinydbItem * @return void */ - protected function _addFromItem($tinydbItem) : void { + protected function _addFromItem($tinydbItem) { // 初期化したいフィールドはunsetする // 新規扱いにするのでidは削除する unset($tinydbItem['TinydbItem']['id']); From fb18879639217999ab35934dd3f52eef2549c7a9 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 8 Nov 2019 08:27:56 +0900 Subject: [PATCH 02/14] =?UTF-8?q?remove:=20travis.yml=E3=81=8B=E3=82=89php?= =?UTF-8?q?5=E7=B3=BB=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4516b68..bed1b15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,6 @@ language: php php: - - 5.4 - - 5.5 - - 5.6 - 7.0 - 7.1 - 7.2 From 7a94191d176669b0c9883e9f99b804ee157051af Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 8 Nov 2019 09:34:51 +0900 Subject: [PATCH 03/14] =?UTF-8?q?change:=20travis-ci=E3=81=A7=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=99=E3=82=8B=E3=81=A8=E3=81=8D=E3=81=AB?= =?UTF-8?q?=E8=87=AA=E5=88=86=E8=87=AA=E8=BA=AB=E3=81=AEautoload=E3=81=8C?= =?UTF-8?q?=E5=8A=B9=E3=81=8B=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7AllTest?= =?UTF-8?q?=E3=81=A0=E3=81=91=E8=87=AA=E5=89=8D=E3=81=AEautoload=E3=82=92?= =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=82=81=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E5=B0=8F=E7=B4=B0=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + Test/Case/AllTinydbTest.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bed1b15..22bc661 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ env: - GIT_AUTHOR_EMAIL=ryuji@ryus.co.jp before_script: + - composer dumpautoload - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - cd $NETCOMMONS_BUILD_DIR diff --git a/Test/Case/AllTinydbTest.php b/Test/Case/AllTinydbTest.php index 5984ec8..63e4388 100644 --- a/Test/Case/AllTinydbTest.php +++ b/Test/Case/AllTinydbTest.php @@ -11,7 +11,9 @@ */ App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); - +if (file_exists(__DIR__ .'/../../vendors/autoload.php')) { + require_once __DIR__ .'/../../vendors/autoload.php'; +} /** * All _Test Test suite * From b2e8415672dd0348f489e39023b6c81216a88819 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 8 Nov 2019 20:31:06 +0900 Subject: [PATCH 04/14] =?UTF-8?q?change:=20travis-ci=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E4=B8=8B=E3=81=ABvendors=E3=81=8C=E6=AE=8B=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=82=8B=E3=81=A8phpcs=E7=AD=89=E3=81=AB=E3=81=B2=E3=81=A3?= =?UTF-8?q?=E3=81=8B=E3=81=8B=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=81cake=20te?= =?UTF-8?q?st=E5=BE=8C=E3=81=AB=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E4=B8=8B=E3=81=AEvendors=E3=81=AF=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 +++- Test/Case/AllTinydbTest.php | 10 ++++++++-- tools/build/travis/main.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100755 tools/build/travis/main.sh diff --git a/.travis.yml b/.travis.yml index 22bc661..8ee3480 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,12 +19,14 @@ env: - GIT_AUTHOR_EMAIL=ryuji@ryus.co.jp before_script: - - composer dumpautoload - 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 + - cd $TRAVIS_BUILD_DIR + - composer dumpautoload + - cd $NETCOMMONS_BUILD_DIR - . tools/build/plugins/cakephp/travis/environment.sh script: diff --git a/Test/Case/AllTinydbTest.php b/Test/Case/AllTinydbTest.php index 63e4388..fb2dbc4 100644 --- a/Test/Case/AllTinydbTest.php +++ b/Test/Case/AllTinydbTest.php @@ -11,9 +11,15 @@ */ App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); -if (file_exists(__DIR__ .'/../../vendors/autoload.php')) { - require_once __DIR__ .'/../../vendors/autoload.php'; + +// travis-ciでのテスト用 +$autoloadPath = getenv('TRAVIS_BUILD_DIR') . '/vendors/autoload.php'; +if (file_exists($autoloadPath)) { + require_once $autoloadPath; } +//if (file_exists(__DIR__ .'/../../vendors/autoload.php')) { +// require_once __DIR__ .'/../../vendors/autoload.php'; +//} /** * All _Test Test suite * diff --git a/tools/build/travis/main.sh b/tools/build/travis/main.sh new file mode 100755 index 0000000..3c7e3fe --- /dev/null +++ b/tools/build/travis/main.sh @@ -0,0 +1,35 @@ +#!/bin/bash -ex + +export PATH=$PATH:./vendors/bin:$NETCOMMONS_BUILD_DIR/vendors/bin + +cd $NETCOMMONS_BUILD_DIR + +# php +app/Console/cake test $PLUGIN_NAME All$PLUGIN_NAME --coverage-clover --stderr || exit $? +phpcs -p --extensions=php,ctp --standard=./vendors/cakephp/cakephp-codesniffer/CakePHP,tools/build/app/phpcs/NetCommons --ignore=app/Config/Migration/,app/Config/database.php,app/Plugin/$PLUGIN_NAME/Config/Migration,app/Plugin/$PLUGIN_NAME/Config/Schema,$IGNORE_PLUGINS,app/Plugin/$PLUGIN_NAME/vendors app/Plugin/$PLUGIN_NAME || exit $? +phpmd app/Plugin/$PLUGIN_NAME text tools/phpmd/rules.xml --exclude $NETCOMMONS_BUILD_DIR/app/Config/Migration,$NETCOMMONS_BUILD_DIR/app/Plugin/$PLUGIN_NAME/Config/Migration,$NETCOMMONS_BUILD_DIR/app/Plugin/$PLUGIN_NAME/Config/Schema,$IGNORE_PLUGINS,app/Plugin/$PLUGIN_NAME/vendors || exit $? +phpcpd --exclude Test --exclude Config --exclude vendors $IGNORE_PLUGINS_OPTS app/Plugin/$PLUGIN_NAME + +# js +gjslint --strict --max_line_length 100 -x jquery.js,jquery.cookie.js,js_debug_toolbar.js,travis.karma.conf.js,my.karma.conf.js -e jasmine_examples,HtmlPurifier,webroot/components,webroot/js/langs -r app/Plugin/$PLUGIN_NAME || exit $? +if [ -d ./app/Plugin/$PLUGIN_NAME/JavascriptTest/ ]; then + ./node_modules/karma/bin/karma start app/Plugin/$PLUGIN_NAME/JavascriptTest/travis.karma.conf.js --single-run --browsers PhantomJS || exit $? +fi + +#Todo: 下記エラーが発生するためphp7.2では、phpdocのテストは行わない +#@see https://travis-ci.org/NetCommons3/Announcements/jobs/568424552#L902-L904 + +PHP_VERSION="`php --version`" +check72=`echo $PHP_VERSION | grep "^PHP 7.2"` + +if [ "$check72" = "" ]; then + # phpdoc + LOG=./app/tmp/logs/phpdoc.log + touch $LOG + chmod a+w $LOG + + echo "phpdoc app/Plugin/$PLUGIN_NAME" + phpdoc parse -d app/Plugin/$PLUGIN_NAME -t $TRAVIS_BUILD_DIR/phpdoc --force --ansi | tee $LOG + [ `grep -c '\[37;41m' $LOG` -ne 0 ] && cat $LOG && exit 1 + echo "phpdoc no error." +fi From 02991e981d4ff2f952622de197ea7ce32819cafb Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 8 Nov 2019 20:31:29 +0900 Subject: [PATCH 05/14] =?UTF-8?q?change:=20travis-ci=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E4=B8=8B=E3=81=ABvendors=E3=81=8C=E6=AE=8B=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=82=8B=E3=81=A8phpcs=E7=AD=89=E3=81=AB=E3=81=B2=E3=81=A3?= =?UTF-8?q?=E3=81=8B=E3=81=8B=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=81cake=20te?= =?UTF-8?q?st=E5=BE=8C=E3=81=AB=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E4=B8=8B=E3=81=AEvendors=E3=81=AF=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 6 ++---- Test/Case/AllTinydbTest.php | 12 ++++++------ tools/build/travis/main.sh | 1 + 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ee3480..c8aed61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,18 +19,16 @@ env: - GIT_AUTHOR_EMAIL=ryuji@ryus.co.jp before_script: + - composer dumpautoload - 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 - - cd $TRAVIS_BUILD_DIR - - composer dumpautoload - - cd $NETCOMMONS_BUILD_DIR - . tools/build/plugins/cakephp/travis/environment.sh script: - - . tools/build/plugins/cakephp/travis/main.sh + - . app/Plugin/$PLUGIN_NAME/tools/build/travis/main.sh after_script: - . tools/build/plugins/cakephp/travis/post.sh diff --git a/Test/Case/AllTinydbTest.php b/Test/Case/AllTinydbTest.php index fb2dbc4..8cd37be 100644 --- a/Test/Case/AllTinydbTest.php +++ b/Test/Case/AllTinydbTest.php @@ -13,13 +13,13 @@ App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); // travis-ciでのテスト用 -$autoloadPath = getenv('TRAVIS_BUILD_DIR') . '/vendors/autoload.php'; -if (file_exists($autoloadPath)) { - require_once $autoloadPath; -} -//if (file_exists(__DIR__ .'/../../vendors/autoload.php')) { -// require_once __DIR__ .'/../../vendors/autoload.php'; +//$autoloadPath = getenv('TRAVIS_BUILD_DIR') . '/vendors/autoload.php'; +//if (file_exists($autoloadPath)) { +// require_once $autoloadPath; //} +if (file_exists(__DIR__ .'/../../vendors/autoload.php')) { + require_once __DIR__ .'/../../vendors/autoload.php'; +} /** * All _Test Test suite * diff --git a/tools/build/travis/main.sh b/tools/build/travis/main.sh index 3c7e3fe..d9613f2 100755 --- a/tools/build/travis/main.sh +++ b/tools/build/travis/main.sh @@ -6,6 +6,7 @@ cd $NETCOMMONS_BUILD_DIR # php app/Console/cake test $PLUGIN_NAME All$PLUGIN_NAME --coverage-clover --stderr || exit $? +rm -rf app/Plugin/$PLUGIN_NAME/vendors phpcs -p --extensions=php,ctp --standard=./vendors/cakephp/cakephp-codesniffer/CakePHP,tools/build/app/phpcs/NetCommons --ignore=app/Config/Migration/,app/Config/database.php,app/Plugin/$PLUGIN_NAME/Config/Migration,app/Plugin/$PLUGIN_NAME/Config/Schema,$IGNORE_PLUGINS,app/Plugin/$PLUGIN_NAME/vendors app/Plugin/$PLUGIN_NAME || exit $? phpmd app/Plugin/$PLUGIN_NAME text tools/phpmd/rules.xml --exclude $NETCOMMONS_BUILD_DIR/app/Config/Migration,$NETCOMMONS_BUILD_DIR/app/Plugin/$PLUGIN_NAME/Config/Migration,$NETCOMMONS_BUILD_DIR/app/Plugin/$PLUGIN_NAME/Config/Schema,$IGNORE_PLUGINS,app/Plugin/$PLUGIN_NAME/vendors || exit $? phpcpd --exclude Test --exclude Config --exclude vendors $IGNORE_PLUGINS_OPTS app/Plugin/$PLUGIN_NAME From f6ba9dbb4501a4dbaab24963bc030521a06efed0 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 8 Nov 2019 21:04:49 +0900 Subject: [PATCH 06/14] style: comment: fix phpcs problem --- .../TinydbBlockTabSettingComponent.php | 32 ++++++- Controller/TinydbAppController.php | 11 ++- Controller/TinydbItemsEditController.php | 14 ++-- Controller/TinydbMailSettingsController.php | 2 - Lib/CurrentDbType.php | 83 +++++++++++++------ Lib/EventManager.php | 53 +++++++++--- Lib/TinydbFunctions.php | 15 +++- Model/AbstractTinydb.php | 28 +------ Model/Tinydb.php | 5 +- Model/TinydbAppModel.php | 20 ++++- Model/TinydbItem.php | 27 ++++-- Model/TinydbSetting.php | 8 ++ Test/Case/AllTinydbTest.php | 9 +- Test/Case/Lib/EventManagerTest.php | 17 +++- Test/Fixture/TinydbFixture.php | 4 + View/TinydbView.php | 18 ++++ 16 files changed, 255 insertions(+), 91 deletions(-) diff --git a/Controller/Component/TinydbBlockTabSettingComponent.php b/Controller/Component/TinydbBlockTabSettingComponent.php index 0141caa..e002d36 100644 --- a/Controller/Component/TinydbBlockTabSettingComponent.php +++ b/Controller/Component/TinydbBlockTabSettingComponent.php @@ -1,4 +1,8 @@ helpers['Blocks.BlockTabs'] = array( 'mainTabs' => array( - 'block_index' => array('url' => array('controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance()->getDbTypeKey() . '_blocks')), - 'frame_settings' => array('url' => array('controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance()->getDbTypeKey() . '_frame_settings')), + 'block_index' => array( + 'url' => array( + 'controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance( + )->getDbTypeKey() . '_blocks' + ) + ), + 'frame_settings' => array( + 'url' => array( + 'controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance( + )->getDbTypeKey() . '_frame_settings' + ) + ), ), 'blockTabs' => array( - 'block_settings' => array('url' => array('controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance()->getDbTypeKey() . '_blocks')), + 'block_settings' => array( + 'url' => array( + 'controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance( + )->getDbTypeKey() . '_blocks' + ) + ), 'mail_settings', - 'role_permissions' => array('url' => array('controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance()->getDbTypeKey() . '_block_role_permissions')), + 'role_permissions' => array( + 'url' => array( + 'controller' => \NetCommons\Tinydb\Lib\CurrentDbType::instance( + )->getDbTypeKey() . '_block_role_permissions' + ) + ), ), ); parent::beforeRender($controller); diff --git a/Controller/TinydbAppController.php b/Controller/TinydbAppController.php index 17321ca..d2a8d88 100644 --- a/Controller/TinydbAppController.php +++ b/Controller/TinydbAppController.php @@ -50,6 +50,11 @@ abstract class TinydbAppController extends AppController { 'Tinydb.TinydbFrameSetting' ); +/** + * beforeFilter + * + * @return void + */ public function beforeFilter() { parent::beforeFilter(); @@ -58,9 +63,13 @@ public function beforeFilter() { $this->plugin ); $this->viewClass = 'Tinydb.Tinydb'; - } +/** + * beforeRender + * + * @return void + */ public function beforeRender() { if ($this->plugin !== 'TestTinydb') { // テスト以外だったら viewPathに含まれるプラグイン名をTinydbに変更 diff --git a/Controller/TinydbItemsEditController.php b/Controller/TinydbItemsEditController.php index e227606..4c56c61 100644 --- a/Controller/TinydbItemsEditController.php +++ b/Controller/TinydbItemsEditController.php @@ -255,14 +255,14 @@ public function delete() { ); } - /** - * ${CARET}_addFromItem - * - * @param $tinydbItem - * @return void - */ +/** + * ${CARET}_addFromItem + * + * @param array $tinydbItem TinydbItem data + * @return void + */ protected function _addFromItem($tinydbItem) { -// 初期化したいフィールドはunsetする + // 初期化したいフィールドはunsetする // 新規扱いにするのでidは削除する unset($tinydbItem['TinydbItem']['id']); unset($tinydbItem['TinydbItem']['key']); diff --git a/Controller/TinydbMailSettingsController.php b/Controller/TinydbMailSettingsController.php index 7d541c0..43312e3 100644 --- a/Controller/TinydbMailSettingsController.php +++ b/Controller/TinydbMailSettingsController.php @@ -51,7 +51,6 @@ public function beforeFilter() { $this->plugin ); $this->viewClass = 'Tinydb.Tinydb'; - } /** @@ -62,7 +61,6 @@ public function beforeFilter() { * @return void */ public function beforeRender() { - // viewPathに含まれるプラグイン名をTinydbに変更 $this->viewPath = str_replace($this->plugin, 'Tinydb', $this->viewPath); diff --git a/Lib/CurrentDbType.php b/Lib/CurrentDbType.php index a9719df..f2d4dd6 100644 --- a/Lib/CurrentDbType.php +++ b/Lib/CurrentDbType.php @@ -1,55 +1,86 @@ dbType = \Inflector::camelize($dbType); + $this->__dbType = \Inflector::camelize($dbType); } +/** + * instance + * + * @return CurrentDbType + */ public static function instance() { //if (self::$selfInstance === null) { // throw new \LogicException('先にinitByFrame()で初期化してください'); //} - return self::$selfInstance; + return self::$__selfInstance; } - public function getDbType() : string { - return $this->dbType; +/** + * getDbType + * + * @return string + */ + public function getDbType() { + return $this->__dbType; } - public function getDbTypeKey() : string { - return \Inflector::underscore($this->dbType); +/** + * getDbTypeKey + * + * @return string + */ + public function getDbTypeKey() { + return \Inflector::underscore($this->__dbType); } - public function isSingleDb() : bool { - // TODO 複数DB使いたいのがでてきたら、DB毎に変更できるようにする +/** + * isSingleDb + * + * @return bool + */ + public function isSingleDb() { + // HACK 複数DB使いたいのがでてきたら、DB毎に変更できるようにする return true; } } \ No newline at end of file diff --git a/Lib/EventManager.php b/Lib/EventManager.php index 5c74309..415f62e 100644 --- a/Lib/EventManager.php +++ b/Lib/EventManager.php @@ -1,17 +1,29 @@ callbacks[$event][] = $callable; + $this->__callbacks[$event][] = $callable; } +/** + * dispatch + * + * @param string $event event name + * @param mixed &$args 引数 + * @return void + */ public function dispatch(string $event, &...$args) { - foreach ($this->callbacks[$event] ?? [] as $callback) { + foreach ($this->__callbacks[$event] ?? [] as $callback) { call_user_func_array($callback, $args); } - } + +/** + * dispatchByArray + * + * @param string $event event name + * @param mixed &$args 引数 + * @return void + */ public function dispatchByArray(string $event, &$args) { - foreach ($this->callbacks[$event] ?? [] as $callback) { + foreach ($this->__callbacks[$event] ?? [] as $callback) { call_user_func_array($callback, $args); } } diff --git a/Lib/TinydbFunctions.php b/Lib/TinydbFunctions.php index faf6318..a046d23 100644 --- a/Lib/TinydbFunctions.php +++ b/Lib/TinydbFunctions.php @@ -1,4 +1,17 @@ __convertToTinydbFrame($frame); -// } -// -///** -// * フレームをTinydbのフレームにする -// * -// * @param array $frame Frame data -// * @return void -// */ -// private function __convertToTinydbFrame(array $frame) { -// $frame['Frame']['plugin_key'] = 'tinydb'; -// $dbType = Inflector::underscore(get_class($this)); -// $frame['Frame']['default_setting_action'] = 'tinydb_blocks/index/db_type:' . $dbType; -// $frameModel = ClassRegistry::init('Frames.Frame'); -// $frameModel->create(); -// $frameModel->save($frame, ['callbacks' => false]); -// } } \ No newline at end of file diff --git a/Model/Tinydb.php b/Model/Tinydb.php index b68a202..9229d79 100644 --- a/Model/Tinydb.php +++ b/Model/Tinydb.php @@ -108,7 +108,10 @@ public function beforeValidate($options = array()) { 'name' => array( 'notBlank' => array( 'rule' => array('notBlank'), - 'message' => sprintf(__tinydbd('net_commons', 'Please input %s.'), __tinydbd('tinydb', 'Tinydb name')), + 'message' => sprintf( + __tinydbd('net_commons', 'Please input %s.'), + __tinydbd('tinydb', 'Tinydb name') + ), 'required' => true ), ), diff --git a/Model/TinydbAppModel.php b/Model/TinydbAppModel.php index b739dfe..4eb388e 100644 --- a/Model/TinydbAppModel.php +++ b/Model/TinydbAppModel.php @@ -9,6 +9,13 @@ */ class TinydbAppModel extends AppModel { +/** + * TinydbAppModel constructor. + * + * @param int|bool $id id + * @param string|null $table table + * @param mixed|null $ds ds + */ public function __construct($id = false, $table = null, $ds = null) { $dbType = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); if ($dbType !== null) { @@ -17,6 +24,13 @@ public function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); } +/** + * _triggerEvent + * + * @param string $localEventName model event name + * @param mixed &$args 引数 + * @return void + */ protected function _triggerEvent(string $localEventName, &...$args) { $dbTypeInstance = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); if ($dbTypeInstance === null) { @@ -27,6 +41,11 @@ protected function _triggerEvent(string $localEventName, &...$args) { \NetCommons\Tinydb\Lib\EventManager::instance()->dispatchByArray($fullEventName, $args); } +/** + * _setUpDbType + * + * @return void + */ protected function _setUpDbType() { // Migration実行時にdbType不定になるので $dbTypeInstance = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); @@ -51,5 +70,4 @@ protected function _setUpDbType() { } } - } diff --git a/Model/TinydbItem.php b/Model/TinydbItem.php index 7b316db..7ba5782 100644 --- a/Model/TinydbItem.php +++ b/Model/TinydbItem.php @@ -111,6 +111,13 @@ class TinydbItem extends TinydbAppModel { ), ); +/** + * TinydbItem constructor. + * + * @param int|bool $id id + * @param string|null $table table + * @param mixed|null $ds ds + */ public function __construct($id = false, $table = null, $ds = null) { $this->_setUpDbType(); $this->_triggerEvent('TinydbItem.construct', $this); @@ -149,6 +156,13 @@ public function beforeValidate($options = array()) { return parent::beforeValidate($options); } +/** + * afterSave + * + * @param bool $created created + * @param array $options options + * @return void + */ public function afterSave($created, $options = array()) { $this->_triggerEvent('TinydbItem.afterSave', $created, $options, $this->data); parent::afterSave($created, $options); @@ -183,7 +197,10 @@ protected function _getValidateSpecification() { 'title' => array( 'notBlank' => [ 'rule' => array('notBlank'), - 'message' => sprintf(__tinydbd('net_commons', 'Please input %s.'), __tinydbd('tinydb', 'Title')), + 'message' => sprintf( + __tinydbd('net_commons', 'Please input %s.'), + __tinydbd('tinydb', 'Title') + ), //'allowEmpty' => false, 'required' => true, //'last' => false, // Stop validation after this rule @@ -193,7 +210,10 @@ protected function _getValidateSpecification() { 'body1' => array( 'notBlank' => [ 'rule' => array('notBlank'), - 'message' => sprintf(__tinydbd('net_commons', 'Please input %s.'), __tinydbd('tinydb', 'Body1')), + 'message' => sprintf( + __tinydbd('net_commons', 'Please input %s.'), + __tinydbd('tinydb', 'Body1') + ), //'allowEmpty' => false, 'required' => true, //'last' => false, // Stop validation after this rule @@ -415,11 +435,9 @@ public function saveItem($data) { } // dbType別の保存 - // TODO バリデート $dbTypeModelName = key($this->hasOne ?? []); if ($dbTypeModelName) { $savedData[$dbTypeModelName]['tinydb_item_id'] = $this->id; - // TODO エラー処理 $this->$dbTypeModelName->save($savedData); } @@ -427,7 +445,6 @@ public function saveItem($data) { $this->set($savedData); $this->saveM17nData(); - $this->commit(); } catch (Exception $e) { diff --git a/Model/TinydbSetting.php b/Model/TinydbSetting.php index d6958d2..04abde9 100644 --- a/Model/TinydbSetting.php +++ b/Model/TinydbSetting.php @@ -53,6 +53,14 @@ class TinydbSetting extends BlockBaseModel { ), ); +/** + * TinydbSetting constructor. + * + * @param bool|int|string|array $id Set this ID for this model on startup, + * can also be an array of options, see above. + * @param string|false $table Name of database table to use. + * @param string $ds DataSource connection name. + */ public function __construct($id = false, $table = null, $ds = null) { $dbTypeInstance = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); if ($dbTypeInstance) { diff --git a/Test/Case/AllTinydbTest.php b/Test/Case/AllTinydbTest.php index 8cd37be..1f4412c 100644 --- a/Test/Case/AllTinydbTest.php +++ b/Test/Case/AllTinydbTest.php @@ -13,13 +13,10 @@ App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); // travis-ciでのテスト用 -//$autoloadPath = getenv('TRAVIS_BUILD_DIR') . '/vendors/autoload.php'; -//if (file_exists($autoloadPath)) { -// require_once $autoloadPath; -//} -if (file_exists(__DIR__ .'/../../vendors/autoload.php')) { - require_once __DIR__ .'/../../vendors/autoload.php'; +if (file_exists(__DIR__ . '/../../vendors/autoload.php')) { + require_once __DIR__ . '/../../vendors/autoload.php'; } + /** * All _Test Test suite * diff --git a/Test/Case/Lib/EventManagerTest.php b/Test/Case/Lib/EventManagerTest.php index 79a3660..fcdb954 100644 --- a/Test/Case/Lib/EventManagerTest.php +++ b/Test/Case/Lib/EventManagerTest.php @@ -1,14 +1,28 @@ attach('Test', function(&$first, &$second) { + $eventManager->attach('Test', function (&$first, &$second) { $first = 1; $second = 2; }); @@ -20,5 +34,4 @@ public function testDispatch() { $this->assertSame(1, $first); $this->assertSame(2, $second); } - } diff --git a/Test/Fixture/TinydbFixture.php b/Test/Fixture/TinydbFixture.php index aa0e9c2..39d9246 100644 --- a/Test/Fixture/TinydbFixture.php +++ b/Test/Fixture/TinydbFixture.php @@ -14,7 +14,11 @@ */ class TinydbFixture extends CakeTestFixture { +/** + * @var string table + */ public $table = 'tinydb'; + /** * Records * diff --git a/View/TinydbView.php b/View/TinydbView.php index ab2d6bf..760174a 100644 --- a/View/TinydbView.php +++ b/View/TinydbView.php @@ -1,7 +1,25 @@ Date: Fri, 8 Nov 2019 21:23:27 +0900 Subject: [PATCH 07/14] =?UTF-8?q?comment:=20phpmd=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=92=E4=B8=80=E9=83=A8=E6=8A=91=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/TinydbAppModel.php | 1 + Model/TinydbItem.php | 1 + Model/TinydbSetting.php | 1 + View/TinydbView.php | 1 + 4 files changed, 4 insertions(+) diff --git a/Model/TinydbAppModel.php b/Model/TinydbAppModel.php index 4eb388e..3ae725c 100644 --- a/Model/TinydbAppModel.php +++ b/Model/TinydbAppModel.php @@ -15,6 +15,7 @@ class TinydbAppModel extends AppModel { * @param int|bool $id id * @param string|null $table table * @param mixed|null $ds ds + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ public function __construct($id = false, $table = null, $ds = null) { $dbType = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); diff --git a/Model/TinydbItem.php b/Model/TinydbItem.php index 7ba5782..38d44a5 100644 --- a/Model/TinydbItem.php +++ b/Model/TinydbItem.php @@ -117,6 +117,7 @@ class TinydbItem extends TinydbAppModel { * @param int|bool $id id * @param string|null $table table * @param mixed|null $ds ds + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ public function __construct($id = false, $table = null, $ds = null) { $this->_setUpDbType(); diff --git a/Model/TinydbSetting.php b/Model/TinydbSetting.php index 04abde9..5b8d5b0 100644 --- a/Model/TinydbSetting.php +++ b/Model/TinydbSetting.php @@ -60,6 +60,7 @@ class TinydbSetting extends BlockBaseModel { * can also be an array of options, see above. * @param string|false $table Name of database table to use. * @param string $ds DataSource connection name. + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ public function __construct($id = false, $table = null, $ds = null) { $dbTypeInstance = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); diff --git a/View/TinydbView.php b/View/TinydbView.php index 760174a..4f3f804 100644 --- a/View/TinydbView.php +++ b/View/TinydbView.php @@ -19,6 +19,7 @@ class TinydbView extends View { * @param string|null $plugin plugin * @param bool $cached cached * @return array + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ protected function _paths($plugin = null, $cached = true) { $paths = parent::_paths($plugin, $cached); From c48feb4cd5b0aee3def8f71f22faec40462c6e0d Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 15 Nov 2019 18:32:57 +0900 Subject: [PATCH 08/14] comment: fix phpdoc problem --- Config/Migration/1564277047_add_db_type.php | 7 +++++++ Lib/CurrentDbType.php | 4 ++-- Lib/EventManager.php | 2 +- Test/Case/AllTinydbControllerTest.php | 2 +- Test/Case/AllTinydbModelTest.php | 2 +- Test/Case/AllTinydbTest.php | 2 +- Test/Case/AllTinydbViewElementsTest.php | 2 +- Test/Case/AllTinydbViewHelperTest.php | 2 +- Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php | 2 +- Test/Case/Model/AllTinydbModelTinydbItemTest.php | 2 +- Test/Case/Model/AllTinydbModelTinydbSettingTest.php | 2 +- Test/Case/Model/AllTinydbModelTinydbTest.php | 2 +- Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php | 2 +- Test/Case/Model/Tinydb/CreateTinydbTest.php | 2 +- Test/Case/Model/Tinydb/DeleteTinydbTest.php | 2 +- Test/Case/Model/Tinydb/GetTinydbTest.php | 2 +- Test/Case/Model/Tinydb/SaveTest.php | 2 +- Test/Case/Model/Tinydb/SaveTinydbTest.php | 2 +- Test/Case/Model/Tinydb/ValidateTest.php | 2 +- .../Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php | 2 +- .../TinydbFrameSetting/SaveTinydbFrameSettingTest.php | 2 +- Test/Case/Model/TinydbFrameSetting/ValidateTest.php | 2 +- Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php | 2 +- Test/Case/Model/TinydbItem/GetConditionsTest.php | 2 +- Test/Case/Model/TinydbItem/GetNewTest.php | 2 +- Test/Case/Model/TinydbItem/GetYearMonthCountTest.php | 2 +- Test/Case/Model/TinydbItem/SaveEntryTest.php | 2 +- Test/Case/Model/TinydbItem/ValidateTest.php | 2 +- Test/Case/Model/TinydbItem/YetPublishTest.php | 2 +- Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php | 2 +- Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php | 2 +- Test/Case/View/Elements/ItemFooterTest.php | 2 +- Test/Case/View/Elements/ItemMetaInfoTest.php | 2 +- Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php | 2 +- Test/Case/View/Elements/TinydbBlocks/EditFormTest.php | 2 +- .../View/Elements/TinydbFrameSettings/EditFormTest.php | 2 +- Test/Case/View/Elements/TinydbItems/EditLinkTest.php | 2 +- .../View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php | 2 +- .../View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php | 2 +- .../View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php | 2 +- .../Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php | 2 +- tools/build/travis/main.sh | 2 ++ 42 files changed, 50 insertions(+), 41 deletions(-) diff --git a/Config/Migration/1564277047_add_db_type.php b/Config/Migration/1564277047_add_db_type.php index fa09aaa..c5c6e3d 100644 --- a/Config/Migration/1564277047_add_db_type.php +++ b/Config/Migration/1564277047_add_db_type.php @@ -1,4 +1,11 @@ Date: Fri, 15 Nov 2019 18:50:06 +0900 Subject: [PATCH 09/14] comment: fix phpdoc problem --- Test/Case/AllTinydbControllerTest.php | 1 + Test/Case/AllTinydbModelTest.php | 1 + Test/Case/AllTinydbTest.php | 1 + Test/Case/AllTinydbViewElementsTest.php | 1 + Test/Case/AllTinydbViewHelperTest.php | 1 + Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php | 1 + Test/Case/Model/AllTinydbModelTinydbItemTest.php | 1 + Test/Case/Model/AllTinydbModelTinydbSettingTest.php | 1 + Test/Case/Model/AllTinydbModelTinydbTest.php | 1 + Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php | 1 + Test/Case/Model/Tinydb/CreateTinydbTest.php | 1 + Test/Case/Model/Tinydb/DeleteTinydbTest.php | 1 + Test/Case/Model/Tinydb/GetTinydbTest.php | 1 + Test/Case/Model/Tinydb/SaveTest.php | 1 + Test/Case/Model/Tinydb/SaveTinydbTest.php | 1 + Test/Case/Model/Tinydb/ValidateTest.php | 1 + Test/Case/Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php | 1 + .../Case/Model/TinydbFrameSetting/SaveTinydbFrameSettingTest.php | 1 + Test/Case/Model/TinydbFrameSetting/ValidateTest.php | 1 + Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php | 1 + Test/Case/Model/TinydbItem/GetConditionsTest.php | 1 + Test/Case/Model/TinydbItem/GetNewTest.php | 1 + Test/Case/Model/TinydbItem/GetYearMonthCountTest.php | 1 + Test/Case/Model/TinydbItem/SaveEntryTest.php | 1 + Test/Case/Model/TinydbItem/ValidateTest.php | 1 + Test/Case/Model/TinydbItem/YetPublishTest.php | 1 + Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php | 1 + Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php | 1 + Test/Case/View/Elements/ItemFooterTest.php | 1 + Test/Case/View/Elements/ItemMetaInfoTest.php | 1 + Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php | 1 + Test/Case/View/Elements/TinydbBlocks/EditFormTest.php | 1 + Test/Case/View/Elements/TinydbFrameSettings/EditFormTest.php | 1 + Test/Case/View/Elements/TinydbItems/EditLinkTest.php | 1 + Test/Case/View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php | 1 + Test/Case/View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php | 1 + Test/Case/View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php | 1 + .../Case/View/Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php | 1 + 38 files changed, 38 insertions(+) diff --git a/Test/Case/AllTinydbControllerTest.php b/Test/Case/AllTinydbControllerTest.php index 93841e8..e7c7374 100644 --- a/Test/Case/AllTinydbControllerTest.php +++ b/Test/Case/AllTinydbControllerTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbModelTest.php b/Test/Case/AllTinydbModelTest.php index 4191cf9..cb17140 100644 --- a/Test/Case/AllTinydbModelTest.php +++ b/Test/Case/AllTinydbModelTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbTest.php b/Test/Case/AllTinydbTest.php index 627817e..78af64c 100644 --- a/Test/Case/AllTinydbTest.php +++ b/Test/Case/AllTinydbTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbViewElementsTest.php b/Test/Case/AllTinydbViewElementsTest.php index 4e29a1b..8aa50f3 100644 --- a/Test/Case/AllTinydbViewElementsTest.php +++ b/Test/Case/AllTinydbViewElementsTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbViewHelperTest.php b/Test/Case/AllTinydbViewHelperTest.php index 2a8a251..603c909 100644 --- a/Test/Case/AllTinydbViewHelperTest.php +++ b/Test/Case/AllTinydbViewHelperTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php b/Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php index 640e584..8e0c1ca 100644 --- a/Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php +++ b/Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/AllTinydbModelTinydbItemTest.php b/Test/Case/Model/AllTinydbModelTinydbItemTest.php index e99190c..ff8d281 100644 --- a/Test/Case/Model/AllTinydbModelTinydbItemTest.php +++ b/Test/Case/Model/AllTinydbModelTinydbItemTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/AllTinydbModelTinydbSettingTest.php b/Test/Case/Model/AllTinydbModelTinydbSettingTest.php index 2d35ade..4bbf7b5 100644 --- a/Test/Case/Model/AllTinydbModelTinydbSettingTest.php +++ b/Test/Case/Model/AllTinydbModelTinydbSettingTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/AllTinydbModelTinydbTest.php b/Test/Case/Model/AllTinydbModelTinydbTest.php index 603d037..8316110 100644 --- a/Test/Case/Model/AllTinydbModelTinydbTest.php +++ b/Test/Case/Model/AllTinydbModelTinydbTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php b/Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php index 2602439..47e56c7 100644 --- a/Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php +++ b/Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/Tinydb/CreateTinydbTest.php b/Test/Case/Model/Tinydb/CreateTinydbTest.php index 7402273..5458921 100644 --- a/Test/Case/Model/Tinydb/CreateTinydbTest.php +++ b/Test/Case/Model/Tinydb/CreateTinydbTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsModelTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/Tinydb/DeleteTinydbTest.php b/Test/Case/Model/Tinydb/DeleteTinydbTest.php index 558029b..c92d4fb 100644 --- a/Test/Case/Model/Tinydb/DeleteTinydbTest.php +++ b/Test/Case/Model/Tinydb/DeleteTinydbTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsDeleteTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/Tinydb/GetTinydbTest.php b/Test/Case/Model/Tinydb/GetTinydbTest.php index b789b9f..2948f93 100644 --- a/Test/Case/Model/Tinydb/GetTinydbTest.php +++ b/Test/Case/Model/Tinydb/GetTinydbTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsGetTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/Tinydb/SaveTest.php b/Test/Case/Model/Tinydb/SaveTest.php index ed433ea..19539a5 100644 --- a/Test/Case/Model/Tinydb/SaveTest.php +++ b/Test/Case/Model/Tinydb/SaveTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsModelTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/Tinydb/SaveTinydbTest.php b/Test/Case/Model/Tinydb/SaveTinydbTest.php index 666e97c..c319e4c 100644 --- a/Test/Case/Model/Tinydb/SaveTinydbTest.php +++ b/Test/Case/Model/Tinydb/SaveTinydbTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsSaveTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/Tinydb/ValidateTest.php b/Test/Case/Model/Tinydb/ValidateTest.php index 0b48e4f..9a9d8e8 100644 --- a/Test/Case/Model/Tinydb/ValidateTest.php +++ b/Test/Case/Model/Tinydb/ValidateTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsValidateTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php b/Test/Case/Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php index 4ed85dc..649e68a 100644 --- a/Test/Case/Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php +++ b/Test/Case/Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsGetTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/TinydbFrameSetting/SaveTinydbFrameSettingTest.php b/Test/Case/Model/TinydbFrameSetting/SaveTinydbFrameSettingTest.php index 779492c..066c8b0 100644 --- a/Test/Case/Model/TinydbFrameSetting/SaveTinydbFrameSettingTest.php +++ b/Test/Case/Model/TinydbFrameSetting/SaveTinydbFrameSettingTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsSaveTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/TinydbFrameSetting/ValidateTest.php b/Test/Case/Model/TinydbFrameSetting/ValidateTest.php index 46d9545..5a37aee 100644 --- a/Test/Case/Model/TinydbFrameSetting/ValidateTest.php +++ b/Test/Case/Model/TinydbFrameSetting/ValidateTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsValidateTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php b/Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php index ea9169d..5566686 100644 --- a/Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php +++ b/Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('WorkflowDeleteTest', 'Workflow.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/GetConditionsTest.php b/Test/Case/Model/TinydbItem/GetConditionsTest.php index d2b528b..567e1a8 100644 --- a/Test/Case/Model/TinydbItem/GetConditionsTest.php +++ b/Test/Case/Model/TinydbItem/GetConditionsTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('WorkflowGetTest', 'Workflow.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/GetNewTest.php b/Test/Case/Model/TinydbItem/GetNewTest.php index ef3adf3..5f26421 100644 --- a/Test/Case/Model/TinydbItem/GetNewTest.php +++ b/Test/Case/Model/TinydbItem/GetNewTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('WorkflowGetTest', 'Workflow.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/GetYearMonthCountTest.php b/Test/Case/Model/TinydbItem/GetYearMonthCountTest.php index 9387892..607e66a 100644 --- a/Test/Case/Model/TinydbItem/GetYearMonthCountTest.php +++ b/Test/Case/Model/TinydbItem/GetYearMonthCountTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('WorkflowGetTest', 'Workflow.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/SaveEntryTest.php b/Test/Case/Model/TinydbItem/SaveEntryTest.php index 12d3ca2..8be276d 100644 --- a/Test/Case/Model/TinydbItem/SaveEntryTest.php +++ b/Test/Case/Model/TinydbItem/SaveEntryTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('WorkflowSaveTest', 'Workflow.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/ValidateTest.php b/Test/Case/Model/TinydbItem/ValidateTest.php index e3e0fdb..d2914bb 100644 --- a/Test/Case/Model/TinydbItem/ValidateTest.php +++ b/Test/Case/Model/TinydbItem/ValidateTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsValidateTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/TinydbItem/YetPublishTest.php b/Test/Case/Model/TinydbItem/YetPublishTest.php index 3070c91..27bd206 100644 --- a/Test/Case/Model/TinydbItem/YetPublishTest.php +++ b/Test/Case/Model/TinydbItem/YetPublishTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('WorkflowGetTest', 'Workflow.TestSuite'); diff --git a/Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php b/Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php index 1e55ac4..0004d3c 100644 --- a/Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php +++ b/Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsGetTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php b/Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php index 15f441b..ae56f27 100644 --- a/Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php +++ b/Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsSaveTest', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Elements/ItemFooterTest.php b/Test/Case/View/Elements/ItemFooterTest.php index 29d9e6a..94fa715 100644 --- a/Test/Case/View/Elements/ItemFooterTest.php +++ b/Test/Case/View/Elements/ItemFooterTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Elements/ItemMetaInfoTest.php b/Test/Case/View/Elements/ItemMetaInfoTest.php index 2d52fcb..bf97e4f 100644 --- a/Test/Case/View/Elements/ItemMetaInfoTest.php +++ b/Test/Case/View/Elements/ItemMetaInfoTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php b/Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php index e7d6a5d..a91db93 100644 --- a/Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php +++ b/Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Elements/TinydbBlocks/EditFormTest.php b/Test/Case/View/Elements/TinydbBlocks/EditFormTest.php index 405309b..97fcea6 100644 --- a/Test/Case/View/Elements/TinydbBlocks/EditFormTest.php +++ b/Test/Case/View/Elements/TinydbBlocks/EditFormTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Elements/TinydbFrameSettings/EditFormTest.php b/Test/Case/View/Elements/TinydbFrameSettings/EditFormTest.php index 91fd7c7..eaba501 100644 --- a/Test/Case/View/Elements/TinydbFrameSettings/EditFormTest.php +++ b/Test/Case/View/Elements/TinydbFrameSettings/EditFormTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Elements/TinydbItems/EditLinkTest.php b/Test/Case/View/Elements/TinydbItems/EditLinkTest.php index 5e7fe6f..4d6d238 100644 --- a/Test/Case/View/Elements/TinydbItems/EditLinkTest.php +++ b/Test/Case/View/Elements/TinydbItems/EditLinkTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php b/Test/Case/View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php index d1f0a89..c3b8d61 100644 --- a/Test/Case/View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php +++ b/Test/Case/View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsHelperTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php b/Test/Case/View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php index be97397..57cff03 100644 --- a/Test/Case/View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php +++ b/Test/Case/View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsHelperTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php b/Test/Case/View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php index b3c357d..821ed61 100644 --- a/Test/Case/View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php +++ b/Test/Case/View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsHelperTestCase', 'NetCommons.TestSuite'); diff --git a/Test/Case/View/Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php b/Test/Case/View/Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php index 78c352c..bf28024 100644 --- a/Test/Case/View/Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php +++ b/Test/Case/View/Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php @@ -8,6 +8,7 @@ * @license http://www.netcommons.org/license.txt NetCommons License * @copyright Copyright 2014, NetCommons Project */ + require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsHelperTestCase', 'NetCommons.TestSuite'); From 4dd44e86300bb87ab01bae36ca96c8619c9a2966 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Fri, 15 Nov 2019 20:24:19 +0900 Subject: [PATCH 10/14] comment: fix phpdoc problem --- .../TinydbBlockRolePermissionsController/EditTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Test/Case/Controller/TinydbBlockRolePermissionsController/EditTest.php b/Test/Case/Controller/TinydbBlockRolePermissionsController/EditTest.php index 5eaf1f9..73c0729 100644 --- a/Test/Case/Controller/TinydbBlockRolePermissionsController/EditTest.php +++ b/Test/Case/Controller/TinydbBlockRolePermissionsController/EditTest.php @@ -1,5 +1,4 @@ Date: Fri, 15 Nov 2019 21:04:05 +0900 Subject: [PATCH 11/14] comment: fix phpdoc problem --- Test/Case/AllTinydbControllerTest.php | 3 +++ Test/Case/AllTinydbModelTest.php | 3 +++ Test/Case/AllTinydbTest.php | 3 +++ Test/Case/AllTinydbViewElementsTest.php | 3 +++ Test/Case/AllTinydbViewHelperTest.php | 3 +++ ...dbControllerTinydbBlockRolePermissionsControllerTest.php | 6 +++++- .../AllTinydbControllerTinydbBlocksControllerTest.php | 6 +++++- ...AllTinydbControllerTinydbFrameSettingsControllerTest.php | 6 +++++- .../AllTinydbControllerTinydbItemsControllerTest.php | 6 +++++- .../AllTinydbControllerTinydbItemsEditControllerTest.php | 6 +++++- .../AllTinydbControllerTinydbsAppControllerTest.php | 6 +++++- Test/Case/Controller/TinydbAppController/PrepareTest.php | 6 +++++- .../TinydbBlockRolePermissionsController/EditTest.php | 3 +++ .../Controller/TinydbBlocksController/BeforeFilterTest.php | 6 +++++- Test/Case/Controller/TinydbBlocksController/EditTest.php | 6 +++++- .../Controller/TinydbFrameSettingsController/EditTest.php | 6 +++++- .../Controller/TinydbItemsController/BeforeFilterTest.php | 6 +++++- Test/Case/Controller/TinydbItemsController/IndexTest.php | 6 +++++- Test/Case/Controller/TinydbItemsController/TagTest.php | 6 +++++- Test/Case/Controller/TinydbItemsController/ViewTest.php | 6 +++++- .../Case/Controller/TinydbItemsController/YearMonthTest.php | 6 +++++- Test/Case/Controller/TinydbItemsEditController/AddTest.php | 6 +++++- .../Controller/TinydbItemsEditController/DeleteTest.php | 6 +++++- Test/Case/Controller/TinydbItemsEditController/EditTest.php | 6 +++++- Test/Case/Model/AllTinydbModelTinydbFrameSettingTest.php | 3 +++ Test/Case/Model/AllTinydbModelTinydbItemTest.php | 3 +++ Test/Case/Model/AllTinydbModelTinydbSettingTest.php | 3 +++ Test/Case/Model/AllTinydbModelTinydbTest.php | 3 +++ Test/Case/Model/AllTinydbModelTinydbsAppModelTest.php | 3 +++ Test/Case/Model/Tinydb/CreateTinydbTest.php | 3 +++ Test/Case/Model/Tinydb/DeleteTinydbTest.php | 3 +++ Test/Case/Model/Tinydb/GetTinydbTest.php | 3 +++ Test/Case/Model/Tinydb/SaveTest.php | 3 +++ Test/Case/Model/Tinydb/SaveTinydbTest.php | 3 +++ Test/Case/Model/Tinydb/ValidateTest.php | 3 +++ .../Model/TinydbFrameSetting/GetTinydbFrameSettingTest.php | 3 +++ .../Model/TinydbFrameSetting/SaveTinydbFrameSettingTest.php | 3 +++ Test/Case/Model/TinydbFrameSetting/ValidateTest.php | 3 +++ Test/Case/Model/TinydbItem/DeleteEntryByKeyTest.php | 3 +++ Test/Case/Model/TinydbItem/GetConditionsTest.php | 3 +++ Test/Case/Model/TinydbItem/GetNewTest.php | 3 +++ Test/Case/Model/TinydbItem/GetYearMonthCountTest.php | 3 +++ Test/Case/Model/TinydbItem/SaveEntryTest.php | 3 +++ Test/Case/Model/TinydbItem/ValidateTest.php | 3 +++ Test/Case/Model/TinydbItem/YetPublishTest.php | 3 +++ Test/Case/Model/TinydbSetting/GetTinydbSettingTest.php | 3 +++ Test/Case/Model/TinydbSetting/SaveTinydbSettingTest.php | 3 +++ Test/Case/View/Elements/ItemFooterTest.php | 3 +++ Test/Case/View/Elements/ItemMetaInfoTest.php | 3 +++ Test/Case/View/Elements/TinydbBlocks/DeleteFormTest.php | 3 +++ Test/Case/View/Elements/TinydbBlocks/EditFormTest.php | 3 +++ .../Case/View/Elements/TinydbFrameSettings/EditFormTest.php | 3 +++ Test/Case/View/Elements/TinydbItems/EditLinkTest.php | 3 +++ .../Case/View/Helper/TinydbOgpHelper/ConvertFullUrlTest.php | 3 +++ .../View/Helper/TinydbOgpHelper/GetLocalAccessUrlTest.php | 3 +++ .../View/Helper/TinydbOgpHelper/GetOgImageParamsTest.php | 3 +++ .../View/Helper/TinydbOgpHelper/OgpMetaByTinydbItemTest.php | 3 +++ 57 files changed, 207 insertions(+), 18 deletions(-) diff --git a/Test/Case/AllTinydbControllerTest.php b/Test/Case/AllTinydbControllerTest.php index e7c7374..1cebdda 100644 --- a/Test/Case/AllTinydbControllerTest.php +++ b/Test/Case/AllTinydbControllerTest.php @@ -9,6 +9,9 @@ * @copyright Copyright 2014, NetCommons Project */ +/** + * require + */ require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbModelTest.php b/Test/Case/AllTinydbModelTest.php index cb17140..eac4ddd 100644 --- a/Test/Case/AllTinydbModelTest.php +++ b/Test/Case/AllTinydbModelTest.php @@ -9,6 +9,9 @@ * @copyright Copyright 2014, NetCommons Project */ +/** + * require + */ require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbTest.php b/Test/Case/AllTinydbTest.php index 78af64c..d4dbc5c 100644 --- a/Test/Case/AllTinydbTest.php +++ b/Test/Case/AllTinydbTest.php @@ -9,6 +9,9 @@ * @copyright Copyright 2014, NetCommons Project */ +/** + * require + */ require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbViewElementsTest.php b/Test/Case/AllTinydbViewElementsTest.php index 8aa50f3..e4f1c5a 100644 --- a/Test/Case/AllTinydbViewElementsTest.php +++ b/Test/Case/AllTinydbViewElementsTest.php @@ -9,6 +9,9 @@ * @copyright Copyright 2014, NetCommons Project */ +/** + * require + */ require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/AllTinydbViewHelperTest.php b/Test/Case/AllTinydbViewHelperTest.php index 603c909..903cee0 100644 --- a/Test/Case/AllTinydbViewHelperTest.php +++ b/Test/Case/AllTinydbViewHelperTest.php @@ -9,6 +9,9 @@ * @copyright Copyright 2014, NetCommons Project */ +/** + * require + */ require_once CakePlugin::path('Tinydb') . 'Lib/TinydbFunctions.php'; App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); diff --git a/Test/Case/Controller/AllTinydbControllerTinydbBlockRolePermissionsControllerTest.php b/Test/Case/Controller/AllTinydbControllerTinydbBlockRolePermissionsControllerTest.php index f679c4f..edc0859 100644 --- a/Test/Case/Controller/AllTinydbControllerTinydbBlockRolePermissionsControllerTest.php +++ b/Test/Case/Controller/AllTinydbControllerTinydbBlockRolePermissionsControllerTest.php @@ -1,5 +1,4 @@ Date: Sat, 16 Nov 2019 10:54:12 +0900 Subject: [PATCH 12/14] =?UTF-8?q?remove:=20html=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Elements/item_footer.ctp | 2 -- View/TinydbItems/view.ctp | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/View/Elements/item_footer.ctp b/View/Elements/item_footer.ctp index 30e5a34..07f5dd6 100644 --- a/View/Elements/item_footer.ctp +++ b/View/Elements/item_footer.ctp @@ -10,9 +10,7 @@ ?> - SnsButton->facebook($contentUrl);?> -
SnsButton->twitter($contentUrl, $tinydbItem['TinydbItem']['title']);?>
diff --git a/View/TinydbItems/view.ctp b/View/TinydbItems/view.ctp index 0112e84..ad6b253 100644 --- a/View/TinydbItems/view.ctp +++ b/View/TinydbItems/view.ctp @@ -42,7 +42,6 @@ echo $this->TinydbOgp->ogpMetaByTinydbItem($tinydbItem); element('Tinydb.item_footer'); ?> -
@@ -58,18 +57,6 @@ echo $this->TinydbOgp->ogpMetaByTinydbItem($tinydbItem);
ContentComment->index($tinydbItem); ?> - - - element('ContentComments.index', array( - // 'pluginKey' => $this->request->params['plugin'], - // 'contentKey' => $tinydbItem['TinydbItem']['key'], - // 'isCommentApproved' => $tinydbSetting['use_comment_approval'], - // 'useComment' => $tinydbSetting['use_comment'], - // 'contentCommentCnt' => $tinydbItem['ContentCommentCnt']['cnt'], - // 'redirectUrl' => $this->NetCommonsHtml->url(array('plugin' => 'tinydb', 'controller' => 'tinydb_items', 'action' => 'view', 'frame_id' => Current::read('Frame.id'), 'key' => $tinydbItem['TinydbItem']['key'])), - // )); ?> - -
From ab3a3b1a7248d207501e8e761d99b1c41284b105 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sat, 16 Nov 2019 11:10:11 +0900 Subject: [PATCH 13/14] =?UTF-8?q?fix:=20=E6=96=B0=E7=9D=80=E3=83=97?= =?UTF-8?q?=E3=83=A9=E3=82=B0=E3=82=A4=E3=83=B3=E3=81=AB=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=8C=E3=81=BE?= =?UTF-8?q?=E3=81=A1=E3=81=8C=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/TinydbItem.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Model/TinydbItem.php b/Model/TinydbItem.php index 38d44a5..0b4f229 100644 --- a/Model/TinydbItem.php +++ b/Model/TinydbItem.php @@ -42,7 +42,8 @@ class TinydbItem extends TinydbAppModel { 'fields' => array( 'title' => 'title', 'summary' => 'body1', - 'path' => '/:plugin_key/tinydb_items/view/:block_id/:content_key', + // TODO tinydb_itemsじゃダメなんだな + 'path' => '/:plugin_key/{{db_type}}_items/view/:block_id/:content_key', ), 'search_contents' => array('body2') ), @@ -121,6 +122,7 @@ class TinydbItem extends TinydbAppModel { */ public function __construct($id = false, $table = null, $ds = null) { $this->_setUpDbType(); + $this->__setUpTopicsPath(); $this->_triggerEvent('TinydbItem.construct', $this); parent::__construct($id, $table, $ds); } @@ -495,4 +497,26 @@ public function yetPublish($tinydbItem) { return ($count == 0); } +/** + * 新着プラグインのパスをDbTypeにあわせて変更する + * + * @return void + */ + private function __setUpTopicsPath() { + $dbTypeInstance = \NetCommons\Tinydb\Lib\CurrentDbType::instance(); + if ($dbTypeInstance === null) { + return; + } + $dbType = $dbTypeInstance->getDbType(); + if ($dbType === 'Tinydb') { + return; + } + $snakeCaseDbType = Inflector::underscore($dbType); + $this->actsAs['Topics.Topics']['fields']['path'] = str_replace( + '{{db_type}}', + $snakeCaseDbType, + $this->actsAs['Topics.Topics']['fields']['path'] + ); + } + } From cf5482ea165587bc3b4e0fd0279b0d79e1cc449f Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sun, 17 Nov 2019 17:42:03 +0900 Subject: [PATCH 14/14] =?UTF-8?q?comment:=20=E4=B8=8D=E8=A6=81=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=9FTODO=20=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/TinydbItem.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/TinydbItem.php b/Model/TinydbItem.php index 0b4f229..0b4c9a3 100644 --- a/Model/TinydbItem.php +++ b/Model/TinydbItem.php @@ -42,7 +42,6 @@ class TinydbItem extends TinydbAppModel { 'fields' => array( 'title' => 'title', 'summary' => 'body1', - // TODO tinydb_itemsじゃダメなんだな 'path' => '/:plugin_key/{{db_type}}_items/view/:block_id/:content_key', ), 'search_contents' => array('body2')