From ac5989c9985090014923740fe7aae4b69c20a454 Mon Sep 17 00:00:00 2001 From: umorigu Date: Thu, 24 Jan 2019 00:14:20 +0900 Subject: [PATCH] BugTrack/2422 Rename plugin action support Database counter --- plugin/counter.inc.php | 3 ++- plugin/rename.inc.php | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/counter.inc.php b/plugin/counter.inc.php index ca1cab7..78bac67 100644 --- a/plugin/counter.inc.php +++ b/plugin/counter.inc.php @@ -2,7 +2,7 @@ // PukiWiki - Yet another WikiWikiWeb clone // counter.inc.php // Copyright -// 2002-2017 PukiWiki Development Team +// 2002-2019 PukiWiki Development Team // 2002 Y.MASUI GPL2 http://masui.net/pukiwiki/ masui@masui.net // License: GPL2 // @@ -16,6 +16,7 @@ define('PLUGIN_COUNTER_USE_DB', 0); define('PLUGIN_COUNTER_DB_CONNECT_STRING', 'sqlite:counter/counter.db'); define('PLUGIN_COUNTER_DB_USERNAME', ''); define('PLUGIN_COUNTER_DB_PASSWORD', ''); +global $plugin_counter_db_options; $plugin_counter_db_options = null; // For MySQL // $plugin_counter_db_options = array(PDO::MYSQL_ATTR_INIT_COMMAND => diff --git a/plugin/rename.inc.php b/plugin/rename.inc.php index f85e1d7..45d4335 100644 --- a/plugin/rename.inc.php +++ b/plugin/rename.inc.php @@ -10,9 +10,6 @@ define('PLUGIN_RENAME_LOGPAGE', ':RenameLog'); -if (file_exists(PLUGIN_DIR . 'counter.inc.php')) - require_once(PLUGIN_DIR . 'counter.inc.php'); - function plugin_rename_action() { global $whatsnew; @@ -354,7 +351,9 @@ function plugin_rename_proceed($pages, $files, $exists) foreach ($pages as $old=>$new) { $pages_decoded[decode($old)] = decode($new); } - plugin_counter_page_rename($pages_decoded); + if (exist_plugin('counter')) { + plugin_counter_page_rename($pages_decoded); + } $postdata = get_source(PLUGIN_RENAME_LOGPAGE); $postdata[] = '*' . $now . "\n"; -- 2.11.0