summaryrefslogtreecommitdiff
path: root/ikiwiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-23 07:51:52 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-23 07:51:52 +0000
commit384327bfd0b3b0362a61f30f81b06895238ee360 (patch)
tree771eaedb0a9d2d572c06d78fb15d7d17608eeca3 /ikiwiki
parentbb0193aff3e044e93006ee7ad0aaef1a82adaeee (diff)
proper main sub and loadindex optimisation for cgis
Diffstat (limited to 'ikiwiki')
-rwxr-xr-xikiwiki51
1 files changed, 28 insertions, 23 deletions
diff --git a/ikiwiki b/ikiwiki
index 7f6480e0c..79b7eff90 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -424,26 +424,31 @@ sub globlist_match ($$) { #{{{
return 0;
} #}}}
-# main {{{
-if ($config{setup}) {
- require IkiWiki::Setup;
- setup();
-}
-lockwiki();
-if ($config{wrapper}) {
- require IkiWiki::Wrapper;
- gen_wrapper();
- exit;
-}
-loadindex() unless $config{rebuild};
-if ($config{cgi}) {
- require IkiWiki::CGI;
- cgi();
-}
-else {
- require IkiWiki::Render;
- rcs_update();
- refresh();
- saveindex();
-}
-#}}}
+sub main () { #{{{
+ if ($config{setup}) {
+ require IkiWiki::Setup;
+ setup();
+ }
+
+ lockwiki();
+
+ if ($config{wrapper}) {
+ require IkiWiki::Wrapper;
+ gen_wrapper();
+ exit;
+ }
+
+ if ($config{cgi}) {
+ require IkiWiki::CGI;
+ cgi();
+ }
+ else {
+ loadindex() unless $config{rebuild};
+ require IkiWiki::Render;
+ rcs_update();
+ refresh();
+ saveindex();
+ }
+} #}}}
+
+main;