diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
commit | 703aeaef1a43b07dc5497dba72c98151466396cc (patch) | |
tree | 1e18a6b3fc3c28156c2e56f8a3d515b8dd6a9cf9 /lib/plugins/popularity/helper.php | |
parent | 33c3b3817b00aa9384760813643fac0e33daaaff (diff) | |
parent | 14b3007921f7b66fc9e3621b861a3c83e7e9093c (diff) | |
download | rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.gz rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.bz2 |
Merge remote-tracking branch 'origin/master' into diff_navigation
Diffstat (limited to 'lib/plugins/popularity/helper.php')
-rw-r--r-- | lib/plugins/popularity/helper.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 5bbeddba0..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( @@ -85,7 +88,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { function sendData($data){ $error = ''; $httpClient = new DokuHTTPClient(); - $status = $httpClient->sendRequest($this->submitUrl, $data, 'POST'); + $status = $httpClient->sendRequest($this->submitUrl, array('data' => $data), 'POST'); if ( ! $status ){ $error = $httpClient->error; } @@ -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'){ |