fix some WebGUI::Paths stuff, multi-site plackup

This commit is contained in:
Graham Knop 2010-04-16 08:37:12 -05:00
parent 8c3ecce95f
commit cd9afc78b9
5 changed files with 60 additions and 76 deletions

View file

@ -48,7 +48,6 @@ These subroutines are available from this package:
=cut
has root => ( is => 'ro', isa => 'Str', default => '/data/WebGUI' );
has site => ( is => 'ro', isa => 'Str', default => 'dev.localhost.localdomain.conf' );
has config => ( is => 'rw', isa => 'WebGUI::Config' );
@ -75,7 +74,7 @@ sub BUILD {
$self->config($config);
}
sub psgi_app {
sub to_app {
my $self = shift;
return $self->{psgi_app} ||= $self->compile_psgi_app;
}
@ -83,10 +82,6 @@ sub psgi_app {
sub compile_psgi_app {
my $self = shift;
# Preload all modules in the master (parent) thread before the Server does any
# child forking. This should save a lot of memory in copy-on-write friendly environments.
$self->preload;
# WebGUI is a PSGI app is a Perl code reference. Let's create one.
# Each web request results in a call to this sub
return sub {
@ -143,11 +138,6 @@ sub compile_psgi_app {
};
}
sub preload {
WebGUI::Paths->preloadAll;
}
sub handle {
my ( $session ) = @_;