/[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

Contents of /Webpacus/script/webpacus_server.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 83 - (show annotations)
Mon Nov 21 17:46:27 2005 UTC (18 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 2171 byte(s)
Import of web font-end for WebPAC v2 called WebPACus based on Catalyst
1 #!/usr/bin/perl -w
2
3 BEGIN {
4 $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 $ENV{CATALYST_SCRIPT_GEN} = 12;
6 }
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 my $restart = 0;
20 my $restart_delay = 1;
21 my $restart_regex = '\.yml$|\.yaml$|\.pm$';
22
23 my @argv = @ARGV;
24
25 GetOptions(
26 'debug|d' => \$debug,
27 'fork' => \$fork,
28 'help|?' => \$help,
29 'host=s' => \$host,
30 'port=s' => \$port,
31 'restart|r' => \$restart,
32 'restartdelay|rd=s' => \$restart_delay,
33 'restartregex|rr=s' => \$restart_regex
34 );
35
36 pod2usage(1) if $help;
37
38 if ( $restart ) {
39 $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
40 }
41 if ( $debug ) {
42 $ENV{CATALYST_DEBUG} = 1;
43 }
44
45 require Webpacus;
46
47 Webpacus->run( $port, $host, {
48 argv => \@argv,
49 'fork' => $fork,
50 restart => $restart,
51 restart_delay => $restart_delay,
52 restart_regex => qr/$restart_regex/
53 } );
54
55 1;
56
57 =head1 NAME
58
59 webpacus_server.pl - Catalyst Testserver
60
61 =head1 SYNOPSIS
62
63 webpacus_server.pl [options]
64
65 Options:
66 -d -debug force debug mode
67 -f -fork handle each request in a new process
68 (defaults to false)
69 -? -help display this help and exits
70 -host host (defaults to all)
71 -p -port port (defaults to 3000)
72 -r -restart restart when files got modified
73 (defaults to false)
74 -rd -restartdelay delay between file checks
75 -rr -restartregex regex match files that trigger
76 a restart when modified
77 (defaults to '\.yml$|\.yaml$|\.pm$')
78
79 See also:
80 perldoc Catalyst::Manual
81 perldoc Catalyst::Manual::Intro
82
83 =head1 DESCRIPTION
84
85 Run a Catalyst Testserver for this application.
86
87 =head1 AUTHOR
88
89 Sebastian Riedel, C<sri@oook.de>
90
91 =head1 COPYRIGHT
92
93 Copyright 2004 Sebastian Riedel. All rights reserved.
94
95 This library is free software, you can redistribute it and/or modify
96 it under the same terms as Perl itself.
97
98 =cut

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26