Changeset 480 for trunk/script
- Timestamp:
- 05/31/23 16:33:29 (12 months ago)
- Location:
- trunk/script
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/script/epoll_cgi.pl
r242 r480 1 #!/usr/bin/ perl -w1 #!/usr/bin/env perl 2 2 3 BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' } 4 5 use strict; 6 use warnings; 7 use FindBin; 8 use lib "$FindBin::Bin/../lib"; 9 use Epoll; 10 11 Epoll->run; 3 use Catalyst::ScriptRunner; 4 Catalyst::ScriptRunner->run('Epoll', 'CGI'); 12 5 13 6 1; … … 23 16 =head1 DESCRIPTION 24 17 25 Run a Catalyst application as a cgiscript.18 Run a Catalyst application as a CGI script. 26 19 27 =head1 AUTHOR 20 =head1 AUTHORS 28 21 29 Sebastian Riedel, C<sri@oook.de> 22 Catalyst Contributors, see Catalyst.pm 30 23 31 24 =head1 COPYRIGHT 32 25 33 34 This library is free software, you can redistribute it and/or modify 26 This library is free software. You can redistribute it and/or modify 35 27 it under the same terms as Perl itself. 36 28 37 29 =cut 30 -
trunk/script/epoll_create.pl
r242 r480 1 #!/usr/bin/ perl -w1 #!/usr/bin/env perl 2 2 3 3 use strict; 4 4 use warnings; 5 use Getopt::Long;6 use Pod::Usage;7 use Catalyst::Helper;8 5 9 my $force = 0; 10 my $mech = 0; 11 my $help = 0; 12 13 GetOptions( 14 'nonew|force' => \$force, 15 'mech|mechanize' => \$mech, 16 'help|?' => \$help 17 ); 18 19 pod2usage(1) if ( $help || !$ARGV[0] ); 20 21 my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } ); 22 23 pod2usage(1) unless $helper->mk_component( 'Epoll', @ARGV ); 6 use Catalyst::ScriptRunner; 7 Catalyst::ScriptRunner->run('Epoll', 'Create'); 24 8 25 9 1; … … 34 18 35 19 Options: 36 - force don't create a .new file where a file to be created exists37 - mechanize use Test::WWW::Mechanize::Catalyst for tests if available38 - help display this help and exits20 --force don't create a .new file where a file to be created exists 21 --mechanize use Test::WWW::Mechanize::Catalyst for tests if available 22 --help display this help and exits 39 23 40 24 Examples: 41 25 epoll_create.pl controller My::Controller 42 epoll_create.pl - mechanize controller My::Controller26 epoll_create.pl --mechanize controller My::Controller 43 27 epoll_create.pl view My::View 44 epoll_create.pl view MyView TT 45 epoll_create.pl view TT TT 28 epoll_create.pl view HTML TT 46 29 epoll_create.pl model My::Model 47 30 epoll_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\ 48 31 dbi:SQLite:/tmp/my.db 49 32 epoll_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\ 50 dbi:Pg:dbname=foo root 4321 33 [Loader opts like db_schema, naming] dbi:Pg:dbname=foo root 4321 34 [connect_info opts like quote_char, name_sep] 51 35 52 36 See also: 53 37 perldoc Catalyst::Manual 54 38 perldoc Catalyst::Manual::Intro 39 perldoc Catalyst::Helper::Model::DBIC::Schema 40 perldoc Catalyst::Model::DBIC::Schema 41 perldoc Catalyst::View::TT 55 42 56 43 =head1 DESCRIPTION … … 62 49 This behavior can be suppressed with the C<-force> option. 63 50 64 =head1 AUTHOR 51 =head1 AUTHORS 65 52 66 Sebastian Riedel, C<sri@oook.de> 67 Maintained by the Catalyst Core Team. 53 Catalyst Contributors, see Catalyst.pm 68 54 69 55 =head1 COPYRIGHT 70 56 71 This library is free software , you can redistribute it and/or modify57 This library is free software. You can redistribute it and/or modify 72 58 it under the same terms as Perl itself. 73 59 -
trunk/script/epoll_fastcgi.pl
r242 r480 1 #!/usr/bin/ perl -w1 #!/usr/bin/env perl 2 2 3 BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' } 4 5 use strict; 6 use warnings; 7 use Getopt::Long; 8 use Pod::Usage; 9 use FindBin; 10 use lib "$FindBin::Bin/../lib"; 11 use Epoll; 12 13 my $help = 0; 14 my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr ); 15 16 GetOptions( 17 'help|?' => \$help, 18 'listen|l=s' => \$listen, 19 'nproc|n=i' => \$nproc, 20 'pidfile|p=s' => \$pidfile, 21 'manager|M=s' => \$manager, 22 'daemon|d' => \$detach, 23 'keeperr|e' => \$keep_stderr, 24 ); 25 26 pod2usage(1) if $help; 27 28 Epoll->run( 29 $listen, 30 { nproc => $nproc, 31 pidfile => $pidfile, 32 manager => $manager, 33 detach => $detach, 34 keep_stderr => $keep_stderr, 35 } 36 ); 3 use Catalyst::ScriptRunner; 4 Catalyst::ScriptRunner->run('Epoll', 'FastCGI'); 37 5 38 6 1; … … 45 13 46 14 epoll_fastcgi.pl [options] 47 15 48 16 Options: 49 -? - help display this help and exits50 -l - listen Socket path to listen on17 -? --help display this help and exit 18 -l --listen socket path to listen on 51 19 (defaults to standard input) 52 20 can be HOST:PORT, :PORT or a 53 21 filesystem path 54 -n - nprocspecify number of processes to keep22 -n --nproc specify number of processes to keep 55 23 to serve requests (defaults to 1, 56 requires - listen)57 -p - pidfilespecify filename for pid file58 (requires - listen)59 -d - daemon daemonize (requires-listen)60 -M - managerspecify alternate process manager24 requires --listen) 25 -p --pidfile specify filename for pid file 26 (requires --listen) 27 -d --daemon daemonize (requires --listen) 28 -M --manager specify alternate process manager 61 29 (FCGI::ProcManager sub-class) 62 30 or empty string to disable 63 -e - keeperrsend error messages to STDOUT, not31 -e --keeperr send error messages to STDOUT, not 64 32 to the webserver 33 --proc_title Set the process title (if possible) 65 34 66 35 =head1 DESCRIPTION 67 36 68 Run a Catalyst application as fastcgi.37 Run a Catalyst application as FastCGI. 69 38 70 =head1 AUTHOR 39 =head1 AUTHORS 71 40 72 Sebastian Riedel, C<sri@oook.de> 73 Maintained by the Catalyst Core Team. 41 Catalyst Contributors, see Catalyst.pm 74 42 75 43 =head1 COPYRIGHT 76 44 77 This library is free software , you can redistribute it and/or modify45 This library is free software. You can redistribute it and/or modify 78 46 it under the same terms as Perl itself. 79 47 -
trunk/script/epoll_server.pl
r242 r480 1 #!/usr/bin/ perl -w1 #!/usr/bin/env perl 2 2 3 BEGIN { 4 $ENV{CATALYST_ENGINE} ||= 'HTTP'; 5 $ENV{CATALYST_SCRIPT_GEN} = 30; 6 require Catalyst::Engine::HTTP; 7 } 8 9 use strict; 10 use warnings; 11 use Getopt::Long; 12 use Pod::Usage; 13 use FindBin; 14 use lib "$FindBin::Bin/../lib"; 15 16 my $debug = 0; 17 my $fork = 0; 18 my $help = 0; 19 my $host = undef; 20 my $port = 3000; 21 my $keepalive = 0; 22 my $restart = 0; 23 my $restart_delay = 1; 24 my $restart_regex = '\.yml$|\.yaml$|\.pm$'; 25 my $restart_directory = undef; 26 27 my @argv = @ARGV; 28 29 GetOptions( 30 'debug|d' => \$debug, 31 'fork' => \$fork, 32 'help|?' => \$help, 33 'host=s' => \$host, 34 'port=s' => \$port, 35 'keepalive|k' => \$keepalive, 36 'restart|r' => \$restart, 37 'restartdelay|rd=s' => \$restart_delay, 38 'restartregex|rr=s' => \$restart_regex, 39 'restartdirectory=s' => \$restart_directory, 40 ); 41 42 pod2usage(1) if $help; 43 44 if ( $restart ) { 45 $ENV{CATALYST_ENGINE} = 'HTTP::Restarter'; 46 } 47 if ( $debug ) { 48 $ENV{CATALYST_DEBUG} = 1; 3 BEGIN { 4 $ENV{CATALYST_SCRIPT_GEN} = 40; 49 5 } 50 6 51 # This is require instead of use so that the above environment 52 # variables can be set at runtime. 53 require Epoll; 54 55 Epoll->run( $port, $host, { 56 argv => \@argv, 57 'fork' => $fork, 58 keepalive => $keepalive, 59 restart => $restart, 60 restart_delay => $restart_delay, 61 restart_regex => qr/$restart_regex/, 62 restart_directory => $restart_directory, 63 } ); 7 use Catalyst::ScriptRunner; 8 Catalyst::ScriptRunner->run('Epoll', 'Server'); 64 9 65 10 1; … … 67 12 =head1 NAME 68 13 69 epoll_server.pl - Catalyst Test server14 epoll_server.pl - Catalyst Test Server 70 15 71 16 =head1 SYNOPSIS … … 73 18 epoll_server.pl [options] 74 19 75 Options: 76 -d -debug force debug mode 77 -f -fork handle each request in a new process 78 (defaults to false) 79 -? -help display this help and exits 80 -host host (defaults to all) 81 -p -port port (defaults to 3000) 82 -k -keepalive enable keep-alive connections 83 -r -restart restart when files get modified 84 (defaults to false) 85 -rd -restartdelay delay between file checks 86 -rr -restartregex regex match files that trigger 87 a restart when modified 88 (defaults to '\.yml$|\.yaml$|\.pm$') 89 -restartdirectory the directory to search for 90 modified files 91 (defaults to '../') 20 -d --debug force debug mode 21 -f --fork handle each request in a new process 22 (defaults to false) 23 -? --help display this help and exits 24 -h --host host (defaults to all) 25 -p --port port (defaults to 3000) 26 -k --keepalive enable keep-alive connections 27 -r --restart restart when files get modified 28 (defaults to false) 29 -rd --restart_delay delay between file checks 30 (ignored if you have Linux::Inotify2 installed) 31 -rr --restart_regex regex match files that trigger 32 a restart when modified 33 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$') 34 --restart_directory the directory to search for 35 modified files, can be set multiple times 36 (defaults to '[SCRIPT_DIR]/..') 37 --follow_symlinks follow symlinks in search directories 38 (defaults to false. this is a no-op on Win32) 39 --background run the process in the background 40 --pidfile specify filename for pid file 92 41 93 42 See also: … … 99 48 Run a Catalyst Testserver for this application. 100 49 101 =head1 AUTHOR 50 =head1 AUTHORS 102 51 103 Sebastian Riedel, C<sri@oook.de> 104 Maintained by the Catalyst Core Team. 52 Catalyst Contributors, see Catalyst.pm 105 53 106 54 =head1 COPYRIGHT 107 55 108 This library is free software , you can redistribute it and/or modify56 This library is free software. You can redistribute it and/or modify 109 57 it under the same terms as Perl itself. 110 58 111 59 =cut 60 -
trunk/script/epoll_test.pl
r242 r480 1 #!/usr/bin/ perl -w1 #!/usr/bin/env perl 2 2 3 use strict; 4 use warnings; 5 use Getopt::Long; 6 use Pod::Usage; 7 use FindBin; 8 use lib "$FindBin::Bin/../lib"; 9 use Catalyst::Test 'Epoll'; 10 11 my $help = 0; 12 13 GetOptions( 'help|?' => \$help ); 14 15 pod2usage(1) if ( $help || !$ARGV[0] ); 16 17 print request($ARGV[0])->content . "\n"; 3 use Catalyst::ScriptRunner; 4 Catalyst::ScriptRunner->run('Epoll', 'Test'); 18 5 19 6 1; … … 28 15 29 16 Options: 30 - help display this help and exits17 --help display this help and exits 31 18 32 19 Examples: … … 42 29 Run a Catalyst action from the command line. 43 30 44 =head1 AUTHOR 31 =head1 AUTHORS 45 32 46 Sebastian Riedel, C<sri@oook.de> 47 Maintained by the Catalyst Core Team. 33 Catalyst Contributors, see Catalyst.pm 48 34 49 35 =head1 COPYRIGHT 50 36 51 This library is free software , you can redistribute it and/or modify37 This library is free software. You can redistribute it and/or modify 52 38 it under the same terms as Perl itself. 53 39
Note: See TracChangeset
for help on using the changeset viewer.