--- wiki.pl Sat Apr 21 19:44:10 2001 +++ newwiki.pl Mon Feb 17 16:55:53 2003 @@ -69,6 +69,7 @@ $RcDefault = 30; # Default number of RecentChanges days @RcDays = qw(1 3 7 30 90); # Days for links on RecentChanges $KeepDays = 14; # Days to keep old revisions + # 0 = keep all revisions; $SiteBase = ""; # Full URL for <BASE> header $FullUrl = ""; # Set if the auto-detected URL is wrong $RedirType = 1; # 1 = CGI.pm, 2 = script, 3 = no redirect @@ -1860,6 +1861,8 @@ my ($fname, $data, @kplist, %tempSection, $expirets); my ($anyExpire, $anyKeep, $expire, %keepFlag, $sectName, $sectRev); my ($oldMajor, $oldAuthor); + + return unless $KeepDays; # PATCH PermanentRevisionHistory $fname = &KeepFileName(); return if (!(-f $fname));
-- JoshJore?
+ return unless '$KeepFile'; # PATCH PermanentRevisionHistoryshould be
+ return unless '$KeepDays'; # PATCH PermanentRevisionHistory
-- Johnson
Does this create a performance hit over time? I am not clear about how it is architected. -- ChrisBurbridge
The basic "architecture" of the keep files (used for revision history) is that they are simply sequential dumps of the .db file contents, separated by a special $FS character sequence. The entire keep file is read into memory when it is used, and then it is split into individual revisions. This means that the script uses at at least (2 * size-of-keep-file) bytes of memory whenever a page is edited or non-cached diffs are displayed. (In 1.0 there is a setting to limit the maximum size of a keep file--this was required for MeatballWiki.)
$PermaDir = "$DataDir/perma"; # Stores permanent kept (old) page dataarchitected database as
sub CreatePermaFile { my ($path, $dir) = @_; &CreateDir($path); if ($dir =~ m|([^/]+)/|) { $path .= "/" . $1 . "/" . $Page{'revision'}.'kp'; # (or $path .= "/" . $1 . "/" . ($Page{'revision'} % 10) . "/" . $Page{'revision'}.'kp';) $dir =~ s/([^\/]+)\///; &CreatePermaFile($path,$dir); } } sub CreatePermaDir { my ($dir, $id) = @_; my $subdir; &CreateDir($dir); # Make sure main page exists $subdir = $dir . "/" . &GetPageDirectory($id); &CreateDir($subdir); $subdir = $dir . "/" . &GetPageDirectory($id) . "/" . $id; &CreateDir($subdir); # (if or: $subdir = $dir . "/" . &GetPageDirectory($id) . "/" . $id . "/" . ($Page{'revision'} % 10);) &CreatePermaFile($subdir,$id); }--JuanmaMP