From 7d8a6abbb21979fd77dca10275ebb8e01a04b6e4 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Mon, 29 Jul 2013 16:33:44 +0200 Subject: Fix popularity data submission in the backend FS#2808 The POST data contained the raw data instead of an array with the data that should be submitted like in the requests from the browser. The server backend has been fixed to be able to process both versions. --- lib/plugins/popularity/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/plugins/popularity/helper.php') diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 5bbeddba0..0e38bcb88 100644 --- a/lib/plugins/popularity/helper.php +++ b/lib/plugins/popularity/helper.php @@ -85,7 +85,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; } -- cgit v1.2.3 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/helper.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/plugins/popularity/helper.php') 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/helper.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'lib/plugins/popularity/helper.php') 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/popularity/helper.php') 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