|
Lines 42-47
use File::Spec;
Link Here
|
| 42 |
use POSIX; |
42 |
use POSIX; |
| 43 |
use YAML::XS; |
43 |
use YAML::XS; |
| 44 |
use ZOOM; |
44 |
use ZOOM; |
|
|
45 |
use List::MoreUtils qw(any); |
| 45 |
|
46 |
|
| 46 |
use Koha::Caches; |
47 |
use Koha::Caches; |
| 47 |
use Koha::Config::SysPref; |
48 |
use Koha::Config::SysPref; |
|
Lines 978-983
sub needs_install {
Link Here
|
| 978 |
return ($self->preference('Version')) ? 0 : 1; |
979 |
return ($self->preference('Version')) ? 0 : 1; |
| 979 |
} |
980 |
} |
| 980 |
|
981 |
|
|
|
982 |
=head3 is_psgi_or_plack |
| 983 |
|
| 984 |
is_psgi_or_plack returns true if there is an environmental variable |
| 985 |
prefixed with "psgi" or "plack". This is useful for detecting whether |
| 986 |
this is a PSGI app or a CGI app, and implementing code as appropriate. |
| 987 |
|
| 988 |
=cut |
| 989 |
|
| 990 |
sub is_psgi_or_plack { |
| 991 |
my $is_psgi_or_plack = 0; |
| 992 |
if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) { |
| 993 |
$is_psgi_or_plack = 1; |
| 994 |
} |
| 995 |
return $is_psgi_or_plack; |
| 996 |
} |
| 997 |
|
| 998 |
=head3 is_internal_PSGI_request |
| 999 |
|
| 1000 |
is_internal_PSGI_request is used to detect if this request was made |
| 1001 |
from within the individual PSGI app or externally from the mounted PSGI |
| 1002 |
app |
| 1003 |
|
| 1004 |
=cut |
| 1005 |
|
| 1006 |
#NOTE: This is not a very robust method but it's the best we have so far |
| 1007 |
sub is_internal_PSGI_request { |
| 1008 |
my $is_internal = 0; |
| 1009 |
if ( (__PACKAGE__->is_psgi_or_plack) && ( $ENV{REQUEST_URI} !~ /^(\/intranet|\/opac)/ ) ){ |
| 1010 |
$is_internal = 1; |
| 1011 |
} |
| 1012 |
return $is_internal; |
| 1013 |
} |
| 1014 |
|
| 981 |
__END__ |
1015 |
__END__ |
| 982 |
|
1016 |
|
| 983 |
=head1 ENVIRONMENT |
1017 |
=head1 ENVIRONMENT |