Koha/debian/templates/plack.psgi
Tomas Cohen Arazi f9e24c8d4f Bug 13791: (QA followup) fix perlcritic warning
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 10:21:44 -03:00

73 lines
1.7 KiB
Perl
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/perl
# This file is part of Koha.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use Modern::Perl;
use lib("/usr/share/koha/lib");
use lib("/usr/share/koha/lib/installer");
use Plack::Builder;
use Plack::App::CGIBin;
use Plack::App::Directory;
use Plack::App::URLMap;
# Pre-load libraries
use C4::Boolean;
use C4::Branch;
use C4::Category;
use C4::Dates;
use C4::Koha;
use C4::Languages;
use C4::Letters;
use C4::Members;
use C4::XSLT;
use Koha::Database;
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise
{
no warnings 'redefine';
my $old_new = \&CGI::new;
*CGI::new = sub {
my $q = $old_new->( @_ );
$CGI::PARAM_UTF8 = 1;
return $q;
};
}
C4::Context->disable_syspref_cache();
my $intranet = Plack::App::CGIBin->new(
root => '/usr/share/koha/intranet/cgi-bin'
);
my $opac = Plack::App::CGIBin->new(
root => '/usr/share/koha/opac/cgi-bin/opac'
);
# my $api = Plack::App::CGIBin->new(
# root => '/usr/share/koha/api/'
# );
builder {
enable "ReverseProxy";
enable "Plack::Middleware::Static";
mount '/opac' => $opac;
mount '/intranet' => $intranet;
# mount '/api' => $api;
};