[pmwiki-users] Foldered wiki.d Page Store for more than 100k pages in a group

ABClf languefrancaise at gmail.com
Thu Aug 6 12:10:21 CDT 2015


because I use a lot of small files, I have choosen a foldered wiki.d ;
so, in config :

$FmtPV['$Name1']  = 'function_exists("utf8string") ? utf8string($name,
0, 1) : $name{0}';
$WikiDir = new PageStore('wiki.d/{$Group}/{$Name1}/{$FullName}');

My biggest group is for Quotes ; pages are named numerically, from 1,
2, 3, etc., to 99500 (still growing) ;
I would like the coming next pages named 100000 and up to be saved in
folder /11, /12, etc., rather than in folder /1 ;

Well, well, well ;)
does someone know an easy way to get it done ?
Maybe something like that would be fine ?

define a new Name2 variable and use if else switch depending on the
name's length :

$FmtPV['$Name2']  = 'function_exists("utf8string") ? utf8string($name,
0, 2) : $name{0}';
if name [0-9]{6} new PageStore('wiki.d/{$Group}/{$Name2}/{$FullName}');
new PageStore('wiki.d/{$Group}/{$Name1}/{$FullName}');

If yes, how to write the if else statement in config ?

Thank you,

More information about the pmwiki-users mailing list