|
Lines 5-17
use lib qw( ./lib );
Link Here
|
| 5 |
use Plack::Middleware::Debug; |
5 |
use Plack::Middleware::Debug; |
| 6 |
use Plack::App::Directory; |
6 |
use Plack::App::Directory; |
| 7 |
|
7 |
|
| 8 |
#BZ 16357, add timestamps to warnings |
|
|
| 9 |
use Koha::Logger; |
| 10 |
|
| 11 |
my $logger = Koha::Logger->get({ interface => 'plack-error' }); |
| 12 |
$SIG{__WARN__} = sub { $logger->warn(shift); }; |
| 13 |
$SIG{__DIE__} = sub { $logger->fatal(shift); }; |
| 14 |
|
| 15 |
use CGI qw(-utf8 ); # we will lose -utf8 under plack |
8 |
use CGI qw(-utf8 ); # we will lose -utf8 under plack |
| 16 |
{ |
9 |
{ |
| 17 |
no warnings 'redefine'; |
10 |
no warnings 'redefine'; |
|
Lines 54-59
use Koha::DateUtils;
Link Here
|
| 54 |
use Koha::Caches; |
47 |
use Koha::Caches; |
| 55 |
use Koha::Cache::Memory::Lite; |
48 |
use Koha::Cache::Memory::Lite; |
| 56 |
use Koha::Patron::Categories; |
49 |
use Koha::Patron::Categories; |
|
|
50 |
use Koha::Logger; |
| 57 |
|
51 |
|
| 58 |
=for preload |
52 |
=for preload |
| 59 |
use C4::Tags; # FIXME |
53 |
use C4::Tags; # FIXME |
|
Lines 79-84
my $home = sub {
Link Here
|
| 79 |
return [ 302, [ Location => '/cgi-bin/koha/' . ( $ENV{INTRANET} ? 'mainpage.pl' : 'opac-main.pl' ) ] ]; |
73 |
return [ 302, [ Location => '/cgi-bin/koha/' . ( $ENV{INTRANET} ? 'mainpage.pl' : 'opac-main.pl' ) ] ]; |
| 80 |
}; |
74 |
}; |
| 81 |
|
75 |
|
|
|
76 |
Koha::Logger->get; |
| 77 |
|
| 82 |
builder { |
78 |
builder { |
| 83 |
|
79 |
|
| 84 |
# please don't use plugins which are under enable_if $ENV{PLACK_DEBUG} in production! |
80 |
# please don't use plugins which are under enable_if $ENV{PLACK_DEBUG} in production! |
|
Lines 102-107
builder {
Link Here
|
| 102 |
path => qr{^/(intranet|opac)-tmpl/}, |
98 |
path => qr{^/(intranet|opac)-tmpl/}, |
| 103 |
root => "$ENV{INTRANETDIR}/koha-tmpl/"; |
99 |
root => "$ENV{INTRANETDIR}/koha-tmpl/"; |
| 104 |
|
100 |
|
|
|
101 |
enable "Log4perl", category => "plack"; |
| 102 |
enable "LogErrors"; |
| 103 |
enable "LogWarn"; |
| 104 |
|
| 105 |
# + is required so Plack doesn't try to prefix Plack::Middleware:: |
105 |
# + is required so Plack doesn't try to prefix Plack::Middleware:: |
| 106 |
enable "+Koha::Middleware::SetEnv"; |
106 |
enable "+Koha::Middleware::SetEnv"; |
| 107 |
|
107 |
|
| 108 |
- |
|
|