Mojolicious/Command/cgi.pm

filter: Statementstmt 93.7% 15 / 16 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 91.6% 22 / 24 CC 2 SCAR 3.5
CC
2
Cov
89%
run
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« Mojo/Upload.pm ↑ Summary Mojolicious/Command/Author/generate/app.pm »
1 package Mojolicious::Command::cgi;
2 1 ▶use Mojo::Base 'Mojolicious::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use Mojo::Server::CGI;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Mojo::Util qw(getopt);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 has description => 'Start application with CGI';
8 1 ▶has usage => sub { shift->extract_usage };
Subroutine __ANON__: called CC=1 SCAR=0.0
9  
10 1 ▶sub run {
Subroutine run: called CC=2 SCAR=8.1
Pod documented
11 1 my ($self, @args) = @_;
12 1 ▶ die $self->usage unless getopt \@args, nph => \(my $nph = 0);
Branch: 1 branch
BranchTrueFalseTotal
unless getopt(\@args, "nph", \(my $nph = 0)) 1 0 1
13 0 Mojo::Server::CGI->new(app => $self->app, nph => $nph)->run;
14 }
15  
16 1 1;
17  
18 =encoding utf8
19  
20 =head1 NAME
21  
22 Mojolicious::Command::cgi - CGI command
23  
24 =head1 SYNOPSIS
25  
26 Usage: APPLICATION cgi [OPTIONS]
27  
28 ./myapp.pl cgi
29  
30 Options:
31 -h, --help Show this summary of available options
32 --home <path> Path to home directory of your application, defaults to
33 the value of MOJO_HOME or auto-detection
34 -m, --mode <name> Operating mode for your application, defaults to the
35 value of MOJO_MODE/PLACK_ENV or "development"
36 --nph Enable non-parsed-header mode
37  
38 =head1 DESCRIPTION
39  
40 L<Mojolicious::Command::cgi> starts applications with the L<Mojo::Server::CGI> backend.
41  
42 This is a core command, that means it is always enabled and its code a good example for learning to build new commands,
43 you're welcome to fork it.
44  
45 See L<Mojolicious::Commands/"COMMANDS"> for a list of commands that are available by default.
46  
47 =head1 ATTRIBUTES
48  
49 L<Mojolicious::Command::cgi> inherits all attributes from L<Mojolicious::Command> and implements the following new
50 ones.
51  
52 =head2 description
53  
54 my $description = $cgi->description;
55 $cgi = $cgi->description('Foo');
56  
57 Short description of this command, used for the command list.
58  
59 =head2 usage
60  
61 my $usage = $cgi->usage;
62 $cgi = $cgi->usage('Foo');
63  
64 Usage information for this command, used for the help screen.
65  
66 =head1 METHODS
67  
68 L<Mojolicious::Command::cgi> inherits all methods from L<Mojolicious::Command> and implements the following new ones.
69  
70 =head2 run
71  
72 $cgi->run(@ARGV);
73  
74 Run this command.
75  
76 =head1 SEE ALSO
77  
78 L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
79  
80 =cut
« Mojo/Upload.pm ↑ Summary Mojolicious/Command/Author/generate/app.pm »