From a1f2b5a3ca0af3e89bd77a5c68fd24b02416e60a Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 19 Sep 2013 22:57:17 +0200 Subject: Fixed gathering of version of popularity plugin --- lib/plugins/popularity/admin.php | 3 +-- lib/plugins/popularity/helper.php | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/plugins') diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php index deb8048f4..f90f844e1 100644 --- a/lib/plugins/popularity/admin.php +++ b/lib/plugins/popularity/admin.php @@ -13,7 +13,6 @@ if(!defined('DOKU_INC')) die(); * need to inherit from this class */ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { - var $version; /** * @var helper_plugin_popularity @@ -25,7 +24,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { $this->helper = $this->loadHelper('popularity', false); $pluginInfo = $this->getInfo(); - $this->version = $pluginInfo['date']; + $this->helper->setVersion($pluginInfo['date']); } /** diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 0e38bcb88..9220d6b6d 100644 --- a/lib/plugins/popularity/helper.php +++ b/lib/plugins/popularity/helper.php @@ -69,6 +69,15 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { } + /** + * Sets plugin version + * + * @param string $pluginversion + */ + public function setVersion($pluginversion) { + $this->version = $pluginversion; + } + /** * Check if autosubmit is enabled * @return boolean TRUE if we should send data once a month, FALSE otherwise -- cgit v1.2.3 From f119fb202b56acf8966f17b1ae4525c678b34865 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 14 Oct 2013 16:32:35 +0200 Subject: get version popularity plugin direct from plugin info --- lib/plugins/popularity/admin.php | 3 --- lib/plugins/popularity/helper.php | 14 ++------------ 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'lib/plugins') diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php index f90f844e1..bd2d090e1 100644 --- a/lib/plugins/popularity/admin.php +++ b/lib/plugins/popularity/admin.php @@ -22,9 +22,6 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { function admin_plugin_popularity(){ $this->helper = $this->loadHelper('popularity', false); - - $pluginInfo = $this->getInfo(); - $this->helper->setVersion($pluginInfo['date']); } /** diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 9220d6b6d..9b092f2be 100644 --- a/lib/plugins/popularity/helper.php +++ b/lib/plugins/popularity/helper.php @@ -29,8 +29,6 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { */ var $popularityLastSubmitFile; - var $version; - function helper_plugin_popularity(){ global $conf; @@ -69,15 +67,6 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { } - /** - * Sets plugin version - * - * @param string $pluginversion - */ - public function setVersion($pluginversion) { - $this->version = $pluginversion; - } - /** * Check if autosubmit is enabled * @return boolean TRUE if we should send data once a month, FALSE otherwise @@ -138,11 +127,12 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { $data = array(); $phptime = ini_get('max_execution_time'); @set_time_limit(0); + $pluginInfo = $this->getInfo(); // version $data['anon_id'] = md5(auth_cookiesalt()); $data['version'] = getVersion(); - $data['popversion'] = $this->version; + $data['popversion'] = $pluginInfo['date']; $data['language'] = $conf['lang']; $data['now'] = time(); $data['popauto'] = (int) $this->isAutoSubmitEnabled(); -- cgit v1.2.3 From 36013a6f5c54847cc4a474853d502ad99ae84be6 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 14 Oct 2013 16:44:41 +0200 Subject: add PHPDocs to popularity plugin helper --- lib/plugins/popularity/helper.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/plugins') diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 9b092f2be..eacde06d0 100644 --- a/lib/plugins/popularity/helper.php +++ b/lib/plugins/popularity/helper.php @@ -37,6 +37,11 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { $this->popularityLastSubmitFile = $conf['cachedir'].'/lastSubmitTime.txt'; } + /** + * Return methods of this helper + * + * @return array with methods description + */ function getMethods(){ $result = array(); $result[] = array( @@ -123,6 +128,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { */ function _gather(){ global $conf; + /** @var $auth DokuWiki_Auth_Plugin */ global $auth; $data = array(); $phptime = ini_get('max_execution_time'); @@ -244,6 +250,17 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { return $data; } + /** + * Callback to search and count the content of directories in DokuWiki + * + * @param array &$data Reference to the result data structure + * @param string $base Base usually $conf['datadir'] + * @param string $file current file or directory relative to $base + * @param string $type Type either 'd' for directory or 'f' for file + * @param int $lvl Current recursion depht + * @param array $opts option array as given to search() + * @return bool + */ function _search_count(&$data,$base,$file,$type,$lvl,$opts){ // traverse if($type == 'd'){ -- cgit v1.2.3