====== NSSize Plugin ======
---- plugin ----
description: Calculate disk usage of a namespace
author : Ikuo Obataya
email : I.Obataya@gmail.com
type : syntax
lastupdate : 2016-02-02
compatible : 2012-10-13
depends :
conflicts :
similar :
tags : !discontinued, statistics, maintenance, namespace
downloadurl: https://github.com/iobataya/dokuwiki-plugin-nssize/archive/master.zip
bugtracker : https://github.com/iobataya/dokuwiki-plugin-nssize/issues
sourcerepo : https://github.com/iobataya/dokuwiki-plugin-nssize
----
===== About plugin =====
NSsize DokuWiki plugin calculates and displays the disk usage of a particular namespace. This plugin can display the disk space of 'pages','attic','media','media_attic','meta','media_meta','cache','index','locks' and 'tmp' directories. The last row can show sum of the directories. These displaying items are selectable in the plugin-configuration page.
==== Example ====
#calculate from root namespace.
{{nssize>}}
#calculate wiki namespace.
{{nssize>wiki}}
===== History =====
* 2013.2.3
* Source was moved to GitHub.
* Supported the latest structure of savedir.
* Calculation is conducted by only PHP codes to support other platform like Windows.
* 2008.3.23
* Italian translation was included.
* 2007.10.7
* modified -> to calculate the whole size of cache directory
===== Discussion =====
This plugin does not seem to work with my DokuWiki (version 2008-05-05) installation.
I use test syntax of:
{{nssize>:}}
Which I assume should calculate sizes for the root namespace? It does not also work for any other namespaces too.
One thing I think that is causing my issue is that I have my data directory stored in a separate location and have used the **savedir** configuration parameter to tell DokuWiki where it is.
I assume the nssize plugin does not take this in to account - thus, that it is why it is broken in my DokuWiki setup.
Looking at the code it seems it is not calculating the base data directory correctly:
$base = $this->getPwd();
$base .= "/data/";
Should it not be using **$conf['savedir']** to calculate the base data directory?
--- //[[monideth.pen@one-n.co.uk|Monideth Pen]] 2008/05/07 10:28//
I made the following changes to syntax.php in the handle() function:
* I made the $conf parameter global:
global $conf;
* Then I changed the $base calculation:
//$base = $this->getPwd();
//$base .= "/data/";
$base = $conf['savedir'] . "/";
And that seems to have fixed it. The nssize plugin now seems to work with my DokuWiki setup where I have my data directory in a different location.
--- //[[monideth.pen@one-n.co.uk|Monideth Pen]] 2008/05/07 10:41//
I've created this patch, so that it respects dokuwiki paths when calculating sizes.
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/dokuwiki-plugin-nssize/doku-conf.patch?rev=1.1
i'm using 20091225
--- //[[glen@delfi.ee|Elan Ruusamäe]] 2010/07/28 23:17//