summaryrefslogtreecommitdiff
path: root/lib/plugins/popularity
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-10-19 02:03:21 -0700
committerAndreas Gohr <andi@splitbrain.org>2013-10-19 02:03:21 -0700
commit20eb92c22e9f506cf1e4ba8753093b89769513e4 (patch)
tree7e85b1d89946ab0b8a2aa4455017efa59af7e481 /lib/plugins/popularity
parentaf04db97122918ab66e0ee29fa14516a1ec042a3 (diff)
parent36013a6f5c54847cc4a474853d502ad99ae84be6 (diff)
downloadrpg-20eb92c22e9f506cf1e4ba8753093b89769513e4.tar.gz
rpg-20eb92c22e9f506cf1e4ba8753093b89769513e4.tar.bz2
Merge pull request #342 from splitbrain/popversionfix
Fixed gathering of version of popularity plugin
Diffstat (limited to 'lib/plugins/popularity')
-rw-r--r--lib/plugins/popularity/admin.php4
-rw-r--r--lib/plugins/popularity/helper.php22
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php
index deb8048f4..bd2d090e1 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
@@ -23,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->version = $pluginInfo['date'];
}
/**
diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php
index 0e38bcb88..eacde06d0 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;
@@ -39,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(
@@ -125,15 +128,17 @@ 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');
@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();
@@ -245,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'){