Bug 16044: Use the L1 cache for any objects set in cache
[koha.git] / debian / templates / plack.psgi
blob995fa7213c03b3f33b4dbe22192dc6aa73b454ff
1 #!/usr/bin/perl
3 # This file is part of Koha.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 use Modern::Perl;
20 use lib("/usr/share/koha/lib");
21 use lib("/usr/share/koha/lib/installer");
23 use Plack::Builder;
24 use Plack::App::CGIBin;
25 use Plack::App::Directory;
26 use Plack::App::URLMap;
28 # Pre-load libraries
29 use C4::Boolean;
30 use C4::Branch;
31 use C4::Category;
32 use C4::Koha;
33 use C4::Languages;
34 use C4::Letters;
35 use C4::Members;
36 use C4::XSLT;
37 use Koha::Database;
38 use Koha::DateUtils;
40 use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise
42 no warnings 'redefine';
43 my $old_new = \&CGI::new;
44 *CGI::new = sub {
45 my $q = $old_new->( @_ );
46 $CGI::PARAM_UTF8 = 1;
47 Koha::Cache->flush_L1_cache();
48 return $q;
52 my $intranet = Plack::App::CGIBin->new(
53 root => '/usr/share/koha/intranet/cgi-bin'
56 my $opac = Plack::App::CGIBin->new(
57 root => '/usr/share/koha/opac/cgi-bin/opac'
60 # my $api = Plack::App::CGIBin->new(
61 # root => '/usr/share/koha/api/'
62 # );
64 builder {
66 enable "ReverseProxy";
67 enable "Plack::Middleware::Static";
69 mount '/opac' => $opac;
70 mount '/intranet' => $intranet;
71 # mount '/api' => $api;