Using Plack with the debian psgi file, I get lots of warnings like:
WARNING: Automatically converting Plack::App::CGIBin instance to a PSGI code reference. If you see this warning for each request, you probably need to explicitly call to_app() i.e. Plack::App::CGIBin->new(...)->to_app in your PSGI file.
This patch is aimed to eliminate the warns.
Test plan:
Run Plack with plack.psgi or koha.psgi and verify if you do not see these
warnings anymore.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I tested on Jessie and I see no regressions.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
my $intranet = Plack::App::CGIBin->new(
root => '/usr/share/koha/intranet/cgi-bin'
-);
+)->to_app;
my $opac = Plack::App::CGIBin->new(
root => '/usr/share/koha/opac/cgi-bin/opac'
-);
+)->to_app;
# my $api = Plack::App::CGIBin->new(
# root => '/usr/share/koha/api/'
-# );
+# )->to_app;
builder {
my $CGI_ROOT = $ENV{INTRANET} ? $ENV{INTRANETDIR} : $ENV{OPACDIR};
warn "# using Koha ", $ENV{INTRANET} ? 'intranet' : 'OPAC', " CGI from $CGI_ROOT\n";
-my $app=Plack::App::CGIBin->new(root => $CGI_ROOT);
+my $app=Plack::App::CGIBin->new(root => $CGI_ROOT)->to_app;
my $home = sub {
return [ 302, [ Location => '/cgi-bin/koha/' . ( $ENV{INTRANET} ? 'mainpage.pl' : 'opac-main.pl' ) ] ];
};