Think twice before "improving" anything Haarg has committed

This commit is contained in:
Patrick Donelan 2010-04-17 19:49:53 -04:00
parent 8b05bc9f4d
commit ecc9967f2e
2 changed files with 55 additions and 62 deletions

View file

@ -62,13 +62,9 @@ has site => (
}, },
); );
sub prepare_app {
my $self = shift;
# WebGUI is a PSGI app is a Perl code reference. Let's create one (once).
# Each web request results in a call to this sub # Each web request results in a call to this sub
$self->{psgi_app} = sub { sub call {
my $self = shift;
my $env = shift; my $env = shift;
# Use the PSGI callback style response, which allows for nice things like # Use the PSGI callback style response, which allows for nice things like
@ -120,13 +116,6 @@ sub prepare_app {
$responder->($psgi_response); $responder->($psgi_response);
} }
}; };
};
}
# Each web request results in a call to this sub
sub call {
my $self = shift;
return $self->{psgi_app}->(@_);
} }
sub handle { sub handle {

View file

@ -2,9 +2,13 @@ use strict;
use Plack::Builder; use Plack::Builder;
use Plack::App::File; use Plack::App::File;
use WebGUI; use WebGUI;
# Temporary preload hack
use WebGUI::Paths -preload; use WebGUI::Paths -preload;
use DBI; use DBI;
DBI->install_driver("mysql"); DBI->install_driver("mysql");
# end hack
use WebGUI::Middleware::Debug::Performance; use WebGUI::Middleware::Debug::Performance;
my $config = $ENV{WEBGUI_CONFIG}; my $config = $ENV{WEBGUI_CONFIG};