Патч для работы OddMuse под mod_perl.
--- current-1.432 2004-06-28 23:36:33 +0400 +++ current 2004-07-04 16:33:36 +0400 @@ -280,11 +280,8 @@ $ScriptName = $q->url() unless defined $ScriptName; # URL used in links $FullUrl = $ScriptName unless $FullUrl; # URL used in forms $Now = time; # Reset in case script is persistent - if (not $LastUpdate) { # mod_perl: stat should be unnecessary since LastUpdate persists. - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) - = stat($IndexFile); - $LastUpdate = $mtime; - } + $LastUpdate = (stat($IndexFile))[9]; + $InterSiteInit = 0; %InterSite = (); $NearSiteInit = 0; @@ -295,6 +292,15 @@ $RssInterwikiTranslateInit = 0; %RssInterwikiTranslate = (); %Locks = (); + + # Init variables for mod_perl + $IndexInit =0; + @Blocks = (); + @Flags = (); + $Fragment = ''; + %RecentVisitors = (); + %PagePermanentAnchors = (); + $OpenPageName = ''; # Currently open page $PrintedHeader = 0; # Error messages don't print headers unless necessary CreateDir($DataDir); # Create directory if it doesn't exist @@ -407,8 +413,8 @@ return Clean(GetDownloadLink($OpenPageName, (substr($1, 0, 6) eq 'image/'), $revision)) if ($text =~ m/^#FILE ([^ \n]+)\n/); local $Fragment = ''; # the clean HTML fragment not yet on @Blocks - local @Blocks; # the list of cached HTML blocks - local @Flags; # a list for each block, 1 = dirty, 0 = clean + local @Blocks=(); # the list of cached HTML blocks + local @Flags=(); # a list for each block, 1 = dirty, 0 = clean local @HtmlStack = (); my $htmlre = join('|',(@HtmlTags)); my $smileyregex = join "|", keys %Smilies; @@ -754,7 +760,8 @@ @pages = @pages[0 .. $num - 1] if $#pages >= $num; if (@pages) { # Now save information required for saving the cache of the current page. - local (%Page, $OpenPageName); + local %Page; + local $OpenPageName=''; print '<div class="journal">'; PrintAllPages(1, 1, @pages); print '</div>'; @@ -2370,6 +2377,7 @@ if ($IndexHash{$id}) { %Page = ParseData(ReadFileOrDie(GetPageFile($id))); } else { + %Page = (); $Page{ts} = $Now; $Page{revision} = 0; if ($id eq $HomePage and (open(F,'README') or open(F,"$DataDir/README"))) { @@ -3429,7 +3437,6 @@ WriteRcLog($id, $summary, $minor, $revision, $user, $host, $languages, GetCluster($new)); if ($revision == 1) { unlink($IndexFile); # Regenerate index on next request - $IndexInit = 0; # mod_perl: this variable may persist accross sessions if (grep(/^$id$/, @LockOnCreation)) { WriteStringToFile(GetLockedPageFile($id), 'editing locked.'); }
Дата создания: 2006-05-24 16:07:33 (Фетисов Н. А. (naf))
Последнее изменение: 2006-05-24 16:07:33 (Фетисов Н. А. (naf))
Владелец: Фетисов Н. А. (naf)
Версия: 1
Wiki::Admin Карта раздела Оглавление Изменения за сутки Изменения за неделю Изменения за месяц