I can no longer access my phpWiki pages using the
wiki itself, but still have the GDBM files used
to store them.
I tried to read them using the code below, but
only get the page names with some additional
bytes, which probably are pointers to the actual
data. Could somebody shed some light on this?
I'd like to have the program print the complete
text of all pages to standard output.
This is what I have now (compile with
"gcc -o readpages readpages.c -lgdbm"):
You can use "dumpgdbm" to dump the data also :)
This comes with gdbm.
Please see the php sourcecode in lib/WikiDB/backend/dbaBase.php
Tables:
*
page:
Index: pagename
Values: latestversion . ':' . flags . ':' serialized hash of page meta data
Currently flags = 1 if latest version has empty content.
*
version
Index: version:pagename
Value: serialized hash of revision meta data, including:
quasi-meta-data %content
*
links
index: 'o' . pagename
value: serialized list of pages (names) which pagename links to.
index: 'i' . pagename
value: serialized list of pages which link to pagename
Each table uses a unique prefix for the key to seperate the
page (p), version (v), links (l)
So to get the page HomePage => "pHomePage", and the version (the text you need) => "vHomePage"
The value is php-serialized, which you have to unserialize.
best done with php.
best done by using the existing library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can no longer access my phpWiki pages using the
wiki itself, but still have the GDBM files used
to store them.
I tried to read them using the code below, but
only get the page names with some additional
bytes, which probably are pointers to the actual
data. Could somebody shed some light on this?
I'd like to have the program print the complete
text of all pages to standard output.
This is what I have now (compile with
"gcc -o readpages readpages.c -lgdbm"):
/ readpages.c /
include <errno.h>
include <stdio.h>
include <gdbm.h>
int main(int argc, char *argv[])
{
int i;
}
You can use "dumpgdbm" to dump the data also :)
This comes with gdbm.
Please see the php sourcecode in lib/WikiDB/backend/dbaBase.php
*
*
*
Each table uses a unique prefix for the key to seperate the
page (p), version (v), links (l)
So to get the page HomePage => "pHomePage", and the version (the text you need) => "vHomePage"
The value is php-serialized, which you have to unserialize.
best done with php.
best done by using the existing library.