/[pub]/suikawiki/wikidata/suikawiki-config.ph
Suika

Diff of /suikawiki/wikidata/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12.4.1 by wakaba, Thu Oct 9 09:48:16 2003 UTC revision 1.12.4.2 by wakaba, Sun Nov 9 02:49:12 2003 UTC
# Line 21  use strict; Line 21  use strict;
21    $uri{wiki} = qq($uri{cookie_path}$uri{script_short_name});        $uri{wiki} = qq($uri{cookie_path}$uri{script_short_name});    
22    
23  ## Path to modules and databases  ## Path to modules and databases
24    push @main::INC, 'lib';    use lib 'lib';
25    push @SuikaWiki::Plugin::plugin_directory, (    push @SuikaWiki::Plugin::plugin_directory, (
26          q(lib/SuikaWiki/Plugin/),          q(lib/SuikaWiki/Plugin/),
27          q(misc/plugins/),          q(misc/plugins/),
# Line 35  use strict; Line 35  use strict;
35                   convert                => q(/usr/X11R6/bin/convert),                   convert                => q(/usr/X11R6/bin/convert),
36    );    );
37    
38    BEGIN {
39      require SuikaWiki::Output::CGICarp;
40      $SuikaWiki::Output::CGICarp::CUSTOM_REASON_TEXT = 'Internal WikiEngine Error';
41      CGI::Carp::set_message (sub {
42        my $msg = shift;
43        print STDOUT <<EOH
44    <!DOCTYPE html SYSTEM>
45    <title>$SuikaWiki::Output::CGICarp::CUSTOM_STATUS_CODE $SuikaWiki::Output::CGICarp::CUSTOM_REASON_TEXT</title>
46    <h1>$SuikaWiki::Output::CGICarp::CUSTOM_REASON_TEXT</h1>
47    <p>$msg</p>
48    EOH
49      });
50    }
51    
52  require SuikaWiki::DB::Util::Lock;  require SuikaWiki::DB::Util::Lock;
53  our $locker = SuikaWiki::DB::Util::Lock->new (-directory => q(./wikidata/lock),  our $locker = SuikaWiki::DB::Util::Lock->new (-directory => q(./wikidata/lock),
54     -name => 'wikipage',     -name => 'wikipage',
55     -retry => ($main::ENV{HTTP_USER_AGENT} =~ m#Openbot/3# ? 2 : 80),     -retry => ($main::ENV{HTTP_USER_AGENT} =~ m#Openbot/3# ? 2 : 20),
56     -timeout => 300,                                             -timeout => 3000,
57     -error_handler => sub {     -error_handler => sub {
58       my ($self, %o) = @_;       my ($self, %o) = @_;
59         if ($o{level} eq 'fatal') {
60         open LOG, '>>', $main::PathTo{WikiDatabaseErrorLog};         open LOG, '>>', $main::PathTo{WikiDatabaseErrorLog};
61           print LOG scalar (gmtime)."\@@{[time]} @{[$$]} {$o{level}}: ", $o{msg}, "\n";           print LOG scalar (gmtime)."\@@{[time]} @{[$$]} {$o{level}}: ", $o{msg}, "\n";
62         close LOG;         close LOG;
      if ($o{level} eq 'fatal') {  
63         die $o{msg};         die $o{msg};
64       }       }
65     });     });
# Line 54  $locker->lock or do { Line 68  $locker->lock or do {
68      print LOG scalar (time), " Can't lock\n";      print LOG scalar (time), " Can't lock\n";
69    close LOG;    close LOG;
70    print "Status: 423 Locked\n";    print "Status: 423 Locked\n";
71    die "Can't lock --- already locked";    $SuikaWiki::Output::CGICarp::CUSTOM_STATUS_CODE = 423;
72      die "Can't lock --- already locked; please try again";
73  };  };
74    
75    

Legend:
Removed from v.1.12.4.1  
changed lines
  Added in v.1.12.4.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24