The UseModWiki database is saved as flat files within the $DataDir. See also /DeveloperQuestions?
An important part of the information processing done by the wiki software is to convert the user's input to presentable HTML. This conversion consists of several steps, and it might be helpful to give names to some of the intermediary formats, especially when whitespace, ampersands and non-ASCII characters are parts of links, page names, file names, and URLs. (Actually, version 0.92 of the UseModWiki software does not support ampersands (&) in page names, so there cannot be a page on "AT&T". Pages like http://susning.nu/AT%26T requires software modifications that are not released.)
Each data-field can be a record which uses $FS2 as a field separator ($FS2 = "\xb3".2). These records are called sections.
The sections can have data fields which are records, using, you guessed it, $FS3 as a field separator ($FS3 = "\xb3".3). Text records are the only example of these in the UseModWiki.
rclog consists of records separated by newlines. The records use $FS3 as the field separator.
Each record is of the form, for example,
Timeline|1015901043 38c38 < 2000 - 2001 --- > 2000 - 2001 - 2002
where "Timeline" is the name of the page, "1015901043" is the time of the diff, and the rest is the output of the unix command
diff old_version new_version.
Related functions include:
Page records are stored in, for example, page/D/DataBase.db
Subpage records are stored in, for example, page/D/DataBase/Subpage.db
If a field begins with "text_", then it is expected to be a Section record with a data field which contains a Text record.
$Page = { version => 3, # Data format version revision => 1, # Number of edited times cache_oldmajor => 4, cache_oldauthor => 4, cache_diff_default_major => 1, # =1 is not isEdit cache_diff_default_author => 2, # = 1 if new author, =2 if cache_oldmajor = cache_oldauthor ts_create => 123456217, ts => 123456861, #timestamp, updated every edit text_default => $Section, };
Section records are stored within page and keep-file records.
$Section = { name => 'text_default', version => 1, # Data format version id => 1397, # userid username => 'CliffordAdams', ip => '123.123.212.41', # $ENV{REMOTE_ADDR} host => 'is-provider.net', # inet_aton($ENV{REMOTE_ADDR}), only for real edits, can be slow ts => 123456861, # timestamp tscreate => 123456217, # timestamp of creation, set once at creation keepts => 123456861, # keep timestamp, only used for keep files revision => 4, # number of edits data => $Text },
Text records are stored within section records where $Section{name} begins with "text_".
They are created by the OpenNewText function.
The text record
$Text = { text => qq|This is some nice wiki text|qq, minor => 1, # minor edit flag newauthor => 0, # = 1 if author unknown/diff from previous edit summary => 'Corrected spelling', }
See ExtractingText for some Perl code to do extract this automatically for you.
Each record stored in textfile at, for example, keep/D/DataBase.kp
The keep record is a list of unnamed text-section records which have a 'keepts' field.
$Keep = [ $Section, # revision 1 $Section, # revision 2 .... ];
Users are identified both by a numeric "id" and by their printable username. This is messy. Some actions (such as action=edit) that look for an "id" among the CGI variables (identifying the page name) will find the user ID number if no "id" is given in the URL. If the authentication clockwork is refactored in a future version of UseModWiki, I think user "id" should go, and users should be identified by their username only. --Lars Aronsson
Each record stored in textfile at, for example, user/1/1001.db
$UserData = { username => 'CliffordAdams', id => 1397, randkey => 123456789, rev => 1, # Data format version createtime => 123456220, createip => '123.123.212.41', email => 'rastapop14@hotmail.com', password => '123456789', notify => 0, adminpw => '123456789', linkrandom => 0, toplinkbar => 0, rcdays => 30, rcnewtop => 1, rcall => 0, rcchangehist => 1, editwide => 1, norcdiff => 0, diffrclink => 1, alldiff => 1, defaultdiff => 1, rcshowedit => 0, tzoffset => 0, editrows => 20, editcols => 65, }