@@ -, +, @@ in Plack mode - On a Koha running with Plack - Go to about.pl - Look at line "PGSI:" --- C4/Context.pm | 13 +++++++++++++ about.pl | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) --- a/C4/Context.pm +++ a/C4/Context.pm @@ -113,6 +113,7 @@ use POSIX (); use DateTime::TimeZone; use Module::Load::Conditional qw(can_load); use Carp; +use List::MoreUtils qw(any); use C4::Boolean; use C4::Debug; @@ -1140,6 +1141,18 @@ sub interface { return $context->{interface} // 'opac'; } +=head2 interface + + C4::Context->is_psgi + + Returns if using PSGI mode (Plack) instead of CGI mode + +=cut + +sub is_psgi { + return any { /(^psgi\.|^plack\.)/i } keys %ENV; +} + 1; __END__ --- a/about.pl +++ a/about.pl @@ -23,7 +23,6 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/ any /; use LWP::Simple; use XML::Simple; use Config; @@ -61,7 +60,7 @@ if ($^O ne 'VMS') { my $zebraVersion = `zebraidx -V`; # Check running PSGI env -if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) { +if ( C4::Context->is_psgi ) { $template->param( is_psgi => 1, psgi_server => ($ENV{ PLACK_ENV }) ? "Plack ($ENV{PLACK_ENV})" : --