APR-Emulate-PSGI
view release on metacpan or search on metacpan
use APR::Emulate::PSGI;
my $r = APR::Emulate::PSGI->new($psgi_env);
# Or in a CGI environment:
my $r = APR::Emulate::PSGI->new();
=head1 DESCRIPTION
This class emulates the mod_perl2 APR object. It expects either a
PSGI environment hashref to be passed in, or to read HTTP environment
information from the global %ENV.
Currently this module is little more than a proof of concept. There
are rough edges.
Use at your own discretion. Contributions welcome.
=cut
=head1 METHODS
=over 4
=item new
Creates an object that emulates the mod_perl2 APR object.
my $r = APR::Emulate::PSGI->new($psgi_env);
HTTP environment information is read from the PSGI environment that is
passed in as a parameter. If no PSGI environment is supplied,
environment information is read from the global %ENV.
=cut
=item psgi_status
Returns the numeric HTTP response that should be used when building
a PSGI response.
my $status = $r->psgi_status();
inc/Module/Install.pm view on Meta::CPAN
);
}
my @exts = @{$self->{extensions}};
unless ( @exts ) {
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
}
my $who = $self->_caller;
foreach my $name ( sort keys %seen ) {
local $^W;
lib/APR/Emulate/PSGI.pm view on Meta::CPAN
use APR::Emulate::PSGI;
my $r = APR::Emulate::PSGI->new($psgi_env);
# Or in a CGI environment:
my $r = APR::Emulate::PSGI->new();
=head1 DESCRIPTION
This class emulates the mod_perl2 APR object. It expects either a
PSGI environment hashref to be passed in, or to read HTTP environment
information from the global %ENV.
Currently this module is little more than a proof of concept. There
are rough edges.
Use at your own discretion. Contributions welcome.
=cut
use 5.010000;
use strict;
lib/APR/Emulate/PSGI.pm view on Meta::CPAN
=over 4
=item new
Creates an object that emulates the mod_perl2 APR object.
my $r = APR::Emulate::PSGI->new($psgi_env);
HTTP environment information is read from the PSGI environment that is
passed in as a parameter. If no PSGI environment is supplied,
environment information is read from the global %ENV.
=cut
sub new {
my ( $class, $env ) = @_;
my $self = bless {
'psgi_env' => $env,
'cgi_mode' => ( defined($env) ? 0 : 1 ),
}, $class;
return $self;
( run in 0.559 second using v1.01-cache-2.11-cpan-49f99fa48dc )