/[webpac2]/Webpacus/script/webpacus_server.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /Webpacus/script/webpacus_server.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 223 - (hide annotations)
Mon Dec 5 19:15:06 2005 UTC (18 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 2335 byte(s)
 r11544@llin:  dpavlin | 2005-12-05 16:49:09 +0100
 re-created scripts using catalyst.pl -nonew -scripts Webpacus

1 dpavlin 83 #!/usr/bin/perl -w
2    
3     BEGIN {
4     $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 dpavlin 223 $ENV{CATALYST_SCRIPT_GEN} = 21;
6 dpavlin 83 }
7    
8     use strict;
9     use Getopt::Long;
10     use Pod::Usage;
11     use FindBin;
12     use lib "$FindBin::Bin/../lib";
13    
14     my $debug = 0;
15     my $fork = 0;
16     my $help = 0;
17     my $host = undef;
18     my $port = 3000;
19 dpavlin 223 my $keepalive = 0;
20 dpavlin 83 my $restart = 0;
21     my $restart_delay = 1;
22     my $restart_regex = '\.yml$|\.yaml$|\.pm$';
23    
24     my @argv = @ARGV;
25    
26     GetOptions(
27     'debug|d' => \$debug,
28     'fork' => \$fork,
29     'help|?' => \$help,
30     'host=s' => \$host,
31     'port=s' => \$port,
32 dpavlin 223 'keepalive|k' => \$keepalive,
33 dpavlin 83 'restart|r' => \$restart,
34     'restartdelay|rd=s' => \$restart_delay,
35     'restartregex|rr=s' => \$restart_regex
36     );
37    
38     pod2usage(1) if $help;
39    
40     if ( $restart ) {
41     $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
42     }
43     if ( $debug ) {
44     $ENV{CATALYST_DEBUG} = 1;
45     }
46    
47 dpavlin 223 use Webpacus;
48 dpavlin 83
49     Webpacus->run( $port, $host, {
50 dpavlin 223 argv => \@argv,
51     'fork' => $fork,
52     keepalive => $keepalive,
53     restart => $restart,
54 dpavlin 83 restart_delay => $restart_delay,
55     restart_regex => qr/$restart_regex/
56     } );
57    
58     1;
59    
60     =head1 NAME
61    
62     webpacus_server.pl - Catalyst Testserver
63    
64     =head1 SYNOPSIS
65    
66     webpacus_server.pl [options]
67    
68     Options:
69     -d -debug force debug mode
70     -f -fork handle each request in a new process
71     (defaults to false)
72     -? -help display this help and exits
73     -host host (defaults to all)
74     -p -port port (defaults to 3000)
75 dpavlin 223 -k -keepalive enable keep-alive connections
76 dpavlin 83 -r -restart restart when files got modified
77     (defaults to false)
78     -rd -restartdelay delay between file checks
79     -rr -restartregex regex match files that trigger
80     a restart when modified
81     (defaults to '\.yml$|\.yaml$|\.pm$')
82    
83     See also:
84     perldoc Catalyst::Manual
85     perldoc Catalyst::Manual::Intro
86    
87     =head1 DESCRIPTION
88    
89     Run a Catalyst Testserver for this application.
90    
91     =head1 AUTHOR
92    
93     Sebastian Riedel, C<sri@oook.de>
94    
95     =head1 COPYRIGHT
96    
97     Copyright 2004 Sebastian Riedel. All rights reserved.
98    
99     This library is free software, you can redistribute it and/or modify
100     it under the same terms as Perl itself.
101    
102     =cut

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26