From: Steve W. <sw...@wc...> - 2000-07-03 04:12:03
|
OK, here's my first pass at an administrative module for PhpWiki. I made a new subdirectory, admin/, which has three files in it. One is index.php3, which will work much like the main index.php3: it opens the database and goes through an if/elseif/elseif/else block to decide which file to load. The files it will choose from will be: * serialize all pages * dump all pages as HTML * load a set of serialized pages * lock/unlock pages * rebuild the DB files (for DBM-based Wikis) * load a set of admin forms (default if none of the above apply) I wrote a page which did all the work of dumping the whole database out as serialized hashes, and then accidentally deleted it and lost about 1hr's work... being not entirely discouraged, I wrote these three files. Besides index.php3 is wiki_adminforms.php (not .php3) which is an HTML file mostly. (For now.) I wanted to write out everything I wanted to do before starting to code, and anyone who wants to contribute can start writing files based on the descriptions. Third is a Perl script that reduces the size of a DBM file. I will write all of it in PHP later but wanted to prove I was right about how DBM files lose memory first, and I was... for the savvy sysadmin a Perl script will be faster or more flexible a solution (and can be easily cron'd.) The Perl script shrank the DBM file on wcsb.org from 2,464,640 bytes to 117,574 (there are 91 pages in it). sw ...............................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |