fix some WebGUI::Paths stuff, multi-site plackup
This commit is contained in:
parent
8c3ecce95f
commit
cd9afc78b9
5 changed files with 60 additions and 76 deletions
|
|
@ -37,7 +37,7 @@ sub call {
|
|||
|
||||
my $app = $self->app;
|
||||
weaken $self->{config};
|
||||
|
||||
|
||||
my $config = $self->config or die 'Mandatory config parameter missing';
|
||||
|
||||
# Logger fallback
|
||||
|
|
@ -46,7 +46,7 @@ sub call {
|
|||
}
|
||||
|
||||
my $session = try {
|
||||
$env->{'webgui.session'} = WebGUI::Session->open( $config->getWebguiRoot, $config, $env );
|
||||
$env->{'webgui.session'} = WebGUI::Session->open( $config, $env );
|
||||
} catch {
|
||||
# We don't have a logger object, so for now just warn() the error
|
||||
warn "Unable to instantiate WebGUI::Session - $_";
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ Returns the list of modules to exclude from preloading as an array.
|
|||
|
||||
sub preloadExclude {
|
||||
my $class = shift;
|
||||
my @excludes = _readTextLines($class->preloadExclude);
|
||||
my @excludes = _readTextLines($class->preloadExclusions);
|
||||
return @excludes;
|
||||
}
|
||||
|
||||
|
|
@ -217,8 +217,9 @@ sub preloadAll {
|
|||
|
||||
require WebGUI::Pluggable;
|
||||
|
||||
my @exclusions = $class->preloadExclude;
|
||||
WebGUI::Pluggable::findAndLoad( 'WebGUI', {
|
||||
exclude => \( $class->preloadExclude ),
|
||||
exclude => \@exclusions,
|
||||
onLoadFail => sub { warn sprintf "Error loading %s: %s\n", @_ },
|
||||
});
|
||||
}
|
||||
|
|
@ -226,7 +227,7 @@ sub preloadAll {
|
|||
sub _readTextLines {
|
||||
my $file = shift;
|
||||
my @lines;
|
||||
open my $fh, '<', $file or croak "Cannot open $file: $!";
|
||||
open my $fh, '<', $file or return;
|
||||
while (my $line = <$fh>) {
|
||||
$line =~ s/#.*//;
|
||||
$line =~ s/^\s+//;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue