Skip to content

Commit

Permalink
Tweaked to be more subclassable/reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
frodwith committed Feb 26, 2010
1 parent 965eea0 commit ce62186
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Plack/Handler/Apache2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ sub load_app {
};
}

sub handler {
my $r = shift;

my $psgi = $r->dir_config('psgi_app');
my $app = __PACKAGE__->load_app($psgi);
sub call_app {
my ($class, $r, $app) = @_;

$r->subprocess_env; # let Apache create %ENV for us :)

Expand Down Expand Up @@ -74,6 +71,13 @@ sub handler {
return Apache2::Const::OK;
}

sub handler {
my $class = __PACKAGE__;
my $r = shift;
my $psgi = $r->dir_config('psgi_app');
$class->call_app($class->load_app($psgi));
}

sub _handle_response {
my ($r, $res) = @_;

Expand Down

0 comments on commit ce62186

Please sign in to comment.