Koha/debian/templates/plack.psgi
Jonathan Druart dda7a0a25f Bug 16044: Use the L1 cache for any objects set in cache
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 19:44:43 +00:00

72 lines
1.8 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::Koha;
use C4::Languages;
use C4::Letters;
use C4::Members;
use C4::XSLT;
use Koha::Database;
use Koha::DateUtils;
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;
Koha::Cache->flush_L1_cache();
return $q;
};
}
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;
};