Bug 17189: Add the ability to define several memcached namespaces - Koha::Caches
[koha.git] / misc / plack / koha.psgi
index dbabe91..e24df26 100644 (file)
@@ -12,7 +12,8 @@ use CGI qw(-utf8 ); # we will lose -utf8 under plack
     *CGI::new = sub {
         my $q = $old_new->( @_ );
         $CGI::PARAM_UTF8 = 1;
-        C4::Context->clear_syspref_L1_cache();
+        Koha::Caches->flush_L1_caches();
+        Koha::Cache::Memory::Lite->flush();
         return $q;
     };
 }
@@ -45,6 +46,8 @@ use C4::XSLT;
 use C4::Branch;
 use C4::Category;
 use Koha::DateUtils;
+use Koha::Caches;
+use Koha::Cache::Memory::Lite;
 =for preload
 use C4::Tags; # FIXME
 =cut
@@ -64,7 +67,7 @@ sub watch_for_size {
 
 my $CGI_ROOT = $ENV{INTRANET} ? $ENV{INTRANETDIR} : $ENV{OPACDIR};
 warn "# using Koha ", $ENV{INTRANET} ? 'intranet' : 'OPAC', " CGI from $CGI_ROOT\n";
-my $app=Plack::App::CGIBin->new(root => $CGI_ROOT);
+my $app=Plack::App::CGIBin->new(root => $CGI_ROOT)->to_app;
 my $home = sub {
        return [ 302, [ Location => '/cgi-bin/koha/' . ( $ENV{INTRANET} ? 'mainpage.pl' : 'opac-main.pl' ) ] ];
 };