From: Jeff D. <da...@da...> - 2000-07-18 05:35:30
|
>The pages are stored as MIME e-mail messages, with the meta-data stored >as parameters in the Content-Type: header. > >I also added the ability to make a zip including the archived versions of >the pages. In this case you still get one file per page, formatted >as a multipart MIME message: one part for each version of the page. Okay, so now how to use these zip files? Here's how: The CVS version now has a new config constant WIKI_PGSRC (in wiki_config), which controls the source for the initial page contents when index.php3 is first invoked on an empty database (ie. no FrontPage). If WIKI_PGSRC is set to the name of a zip file, that zip file is used for the initial page contents. If WIKI_PGSRC is set to './pgsrc' then the old behavior results. Note that the unzipping code only supports the 'store' (non-compressed) and 'deflate' compression methods --- furthermore the 'deflate' method is only support if PHP was compiled with zlib support. Also I'm somewhat unconvinced that the unzip code will work on deflated data from all zip programs. According to zip spec, the file CRC and compressed file size can be stored either ahead of the file data, or after the file data. My code only works if its stored ahead of the file data. (I think this is fixable, but is a bit of a pain --- one must determine the compressed data size from the compressed data stream itself.) I don't see much point in fixing it unless this is a problem for some major zipper (eg. PKZIP.) (The unzipper should work on all uncompressed zip files.) So far I've only tested this code with zip files from wiki_zip and from Info-Zip's zip 2.3. If y'all could test it on anything else you've got, that would be great. Jeff |