proper main sub and loadindex optimisation for cgis
parent
bb0193aff3
commit
384327bfd0
|
@ -271,6 +271,8 @@ sub cgi_editpage ($$) { #{{{
|
||||||
my $q=shift;
|
my $q=shift;
|
||||||
my $session=shift;
|
my $session=shift;
|
||||||
|
|
||||||
|
loadindex();
|
||||||
|
|
||||||
eval q{use CGI::FormBuilder};
|
eval q{use CGI::FormBuilder};
|
||||||
my $form = CGI::FormBuilder->new(
|
my $form = CGI::FormBuilder->new(
|
||||||
fields => [qw(do rcsinfo from page content comments)],
|
fields => [qw(do rcsinfo from page content comments)],
|
||||||
|
@ -446,7 +448,6 @@ sub cgi_editpage ($$) { #{{{
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
require IkiWiki::Render;
|
require IkiWiki::Render;
|
||||||
loadindex();
|
|
||||||
refresh();
|
refresh();
|
||||||
saveindex();
|
saveindex();
|
||||||
}
|
}
|
||||||
|
|
29
ikiwiki
29
ikiwiki
|
@ -424,26 +424,31 @@ sub globlist_match ($$) { #{{{
|
||||||
return 0;
|
return 0;
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
# main {{{
|
sub main () { #{{{
|
||||||
if ($config{setup}) {
|
if ($config{setup}) {
|
||||||
require IkiWiki::Setup;
|
require IkiWiki::Setup;
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
lockwiki();
|
|
||||||
if ($config{wrapper}) {
|
lockwiki();
|
||||||
|
|
||||||
|
if ($config{wrapper}) {
|
||||||
require IkiWiki::Wrapper;
|
require IkiWiki::Wrapper;
|
||||||
gen_wrapper();
|
gen_wrapper();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
loadindex() unless $config{rebuild};
|
|
||||||
if ($config{cgi}) {
|
if ($config{cgi}) {
|
||||||
require IkiWiki::CGI;
|
require IkiWiki::CGI;
|
||||||
cgi();
|
cgi();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
loadindex() unless $config{rebuild};
|
||||||
require IkiWiki::Render;
|
require IkiWiki::Render;
|
||||||
rcs_update();
|
rcs_update();
|
||||||
refresh();
|
refresh();
|
||||||
saveindex();
|
saveindex();
|
||||||
}
|
}
|
||||||
#}}}
|
} #}}}
|
||||||
|
|
||||||
|
main;
|
||||||
|
|
Loading…
Reference in New Issue