Skip to content
Snippets Groups Projects
Commit da50466b authored by Andreas Gohr's avatar Andreas Gohr
Browse files

gather namespace stats in popularity plugin

parent 40c347db
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ if(!defined('DOKU_INC')) die(); ...@@ -13,7 +13,7 @@ if(!defined('DOKU_INC')) die();
* need to inherit from this class * need to inherit from this class
*/ */
class admin_plugin_popularity extends DokuWiki_Admin_Plugin { class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
var $version = '2008-02-20'; var $version = '2010-09-17';
/** /**
...@@ -26,7 +26,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { ...@@ -26,7 +26,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
'date' => $this->version, 'date' => $this->version,
'name' => 'Popularity Feedback Plugin', 'name' => 'Popularity Feedback Plugin',
'desc' => 'Send anonymous data about your wiki to the developers.', 'desc' => 'Send anonymous data about your wiki to the developers.',
'url' => 'http://dokuwiki.org/plugin:popularity', 'url' => 'http://www.dokuwiki.org/plugin:popularity',
); );
} }
...@@ -114,6 +114,8 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { ...@@ -114,6 +114,8 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
$data['page_size'] = $list['file_size']; $data['page_size'] = $list['file_size'];
$data['page_biggest'] = $list['file_max']; $data['page_biggest'] = $list['file_max'];
$data['page_smallest'] = $list['file_min']; $data['page_smallest'] = $list['file_min'];
$data['page_nscount'] = $list['dir_count'];
$data['page_nsnest'] = $list['dir_nest'];
if($list['file_count']) $data['page_avg'] = $list['file_size'] / $list['file_count']; if($list['file_count']) $data['page_avg'] = $list['file_size'] / $list['file_count'];
$data['page_oldest'] = $list['file_oldest']; $data['page_oldest'] = $list['file_oldest'];
unset($list); unset($list);
...@@ -125,6 +127,8 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { ...@@ -125,6 +127,8 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
$data['media_size'] = $list['file_size']; $data['media_size'] = $list['file_size'];
$data['media_biggest'] = $list['file_max']; $data['media_biggest'] = $list['file_max'];
$data['media_smallest'] = $list['file_min']; $data['media_smallest'] = $list['file_min'];
$data['media_nscount'] = $list['dir_count'];
$data['media_nsnest'] = $list['dir_nest'];
if($list['file_count']) $data['media_avg'] = $list['file_size'] / $list['file_count']; if($list['file_count']) $data['media_avg'] = $list['file_size'] / $list['file_count'];
unset($list); unset($list);
...@@ -209,6 +213,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { ...@@ -209,6 +213,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
function _search_count(&$data,$base,$file,$type,$lvl,$opts){ function _search_count(&$data,$base,$file,$type,$lvl,$opts){
// traverse // traverse
if($type == 'd'){ if($type == 'd'){
if($data['dir_nest'] < $lvl) $data['dir_nest'] = $lvl;
$data['dir_count']++; $data['dir_count']++;
return true; return true;
} }
...@@ -223,6 +228,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { ...@@ -223,6 +228,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
if($data['file_max'] < $size) $data['file_max'] = $size; if($data['file_max'] < $size) $data['file_max'] = $size;
if(!isset($data['file_oldest']) || $data['file_oldest'] > $date) $data['file_oldest'] = $date; if(!isset($data['file_oldest']) || $data['file_oldest'] > $date) $data['file_oldest'] = $date;
} }
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment