Bugzilla – Attachment 141598 Details for
Bug 31729
Enable automatic filesystem refresh in Plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31729: Add missing brace (and tidy)
Bug-31729-Add-missing-brace-and-tidy.patch (text/plain), 6.07 KB, created by
Martin Renvoize (ashimema)
on 2022-10-11 07:29:50 UTC
(
hide
)
Description:
Bug 31729: Add missing brace (and tidy)
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-10-11 07:29:50 UTC
Size:
6.07 KB
patch
obsolete
>From 361a74963f5a34c025a143be4f9d24c9008f358c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 11 Oct 2022 08:26:36 +0100 >Subject: [PATCH] Bug 31729: Add missing brace (and tidy) > >This adds a missing closing bracket and runs perltidy over the .psgi >scripts. >--- > app.psgi | 13 ++++---- > debian/templates/plack.psgi | 60 ++++++++++++++++++++----------------- > 2 files changed, 39 insertions(+), 34 deletions(-) > >diff --git a/app.psgi b/app.psgi >index 7c6b3f6232..d2ca4a33a2 100644 >--- a/app.psgi >+++ b/app.psgi >@@ -30,13 +30,13 @@ sub psgi_app { > return $server->to_psgi_app; > } > >-my $opac = psgi_app('bin/opac'); >+my $opac = psgi_app('bin/opac'); > my $intranet = psgi_app('bin/intranet'); > >-my $opac_port = $ENV{KOHA_OPAC_PORT} || 5001; >+my $opac_port = $ENV{KOHA_OPAC_PORT} || 5001; > my $intranet_port = $ENV{KOHA_INTRANET_PORT} || 5000; >-my $port2app = { >- $opac_port => $opac, >+my $port2app = { >+ $opac_port => $opac, > $intranet_port => $intranet, > }; > >@@ -48,7 +48,8 @@ builder { > my $app = shift; > sub { > my $env = shift; >- $env->{'koha.app'} = $port2app->{$env->{SERVER_PORT}} || $intranet; >+ $env->{'koha.app'} = >+ $port2app->{ $env->{SERVER_PORT} } || $intranet; > return $app->($env); > } > }; >@@ -58,7 +59,7 @@ builder { > enable '+Koha::Middleware::RealIP'; > > # bz 31729, enable filesystem reload for dev plack >- enable "Refresh", cooldown => 3 if ($ENV{DEV_INSTALL} ; >+ enable "Refresh", cooldown => 3 if ( $ENV{DEV_INSTALL} ); > > sub { > my $env = shift; >diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi >index d1401a17db..aa1735b5c6 100644 >--- a/debian/templates/plack.psgi >+++ b/debian/templates/plack.psgi >@@ -38,12 +38,12 @@ use Koha::DateUtils; > use Koha::Logger; > > use Log::Log4perl; >-use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise >+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->( @_ ); >+ my $q = $old_new->(@_); > $CGI::PARAM_UTF8 = 1; > Koha::Caches->flush_L1_caches(); > Koha::Cache::Memory::Lite->flush(); >@@ -51,16 +51,15 @@ use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise > }; > } > >-my $home = $ENV{KOHA_HOME}; >+my $home = $ENV{KOHA_HOME}; > my $intranet = Plack::App::CGIBin->new( >- root => $ENV{DEV_INSTALL}? $home: "$home/intranet/cgi-bin" >-)->to_app; >+ root => $ENV{DEV_INSTALL} ? $home : "$home/intranet/cgi-bin" )->to_app; > > my $opac = Plack::App::CGIBin->new( >- root => $ENV{DEV_INSTALL}? "$home/opac": "$home/opac/cgi-bin/opac" >-)->to_app; >+ root => $ENV{DEV_INSTALL} ? "$home/opac" : "$home/opac/cgi-bin/opac" ) >+ ->to_app; > >-my $apiv1 = builder { >+my $apiv1 = builder { > my $server = Mojo::Server::PSGI->new; > $server->load_app("$home/api/v1/app.pl"); > $server->to_psgi_app; >@@ -73,52 +72,57 @@ builder { > enable "Plack::Middleware::Static"; > > # bz 31729, enable filesystem reload for dev plack >- enable "Refresh", cooldown => 3 if ($ENV{DEV_INSTALL} ; >+ enable "Refresh", cooldown => 3 >+ if ( $ENV{DEV_INSTALL} ); > > # + is required so Plack doesn't try to prefix Plack::Middleware:: > enable "+Koha::Middleware::SetEnv"; > enable "+Koha::Middleware::RealIP"; > >- mount '/opac' => builder { >+ mount '/opac' => builder { >+ > #NOTE: it is important that these are relative links > enable 'ErrorDocument', >- 400 => 'errors/400.pl', >- 401 => 'errors/401.pl', >- 402 => 'errors/402.pl', >- 403 => 'errors/403.pl', >- 404 => 'errors/404.pl', >- 500 => 'errors/500.pl', >- subrequest => 1; >+ 400 => 'errors/400.pl', >+ 401 => 'errors/401.pl', >+ 402 => 'errors/402.pl', >+ 403 => 'errors/403.pl', >+ 404 => 'errors/404.pl', >+ 500 => 'errors/500.pl', >+ subrequest => 1; >+ > #NOTE: Without this middleware to catch fatal errors, ErrorDocument won't be able to render a 500 document > #NOTE: This middleware must be closer to the PSGI app than ErrorDocument > enable "HTTPExceptions"; >- if ( Log::Log4perl->get_logger('plack-opac')->has_appenders ){ >+ if ( Log::Log4perl->get_logger('plack-opac')->has_appenders ) { > enable 'Log4perl', category => 'plack-opac'; > enable 'LogWarn'; > } > $opac; > }; >- mount '/intranet' => builder { >+ mount '/intranet' => builder { >+ > #NOTE: it is important that these are relative links > enable 'ErrorDocument', >- 400 => 'errors/400.pl', >- 401 => 'errors/401.pl', >- 402 => 'errors/402.pl', >- 403 => 'errors/403.pl', >- 404 => 'errors/404.pl', >- 500 => 'errors/500.pl', >- subrequest => 1; >+ 400 => 'errors/400.pl', >+ 401 => 'errors/401.pl', >+ 402 => 'errors/402.pl', >+ 403 => 'errors/403.pl', >+ 404 => 'errors/404.pl', >+ 500 => 'errors/500.pl', >+ subrequest => 1; >+ > #NOTE: Without this middleware to catch fatal errors, ErrorDocument won't be able to render a 500 document > #NOTE: This middleware must be closer to the PSGI app than ErrorDocument > enable "HTTPExceptions"; >- if ( Log::Log4perl->get_logger('plack-intranet')->has_appenders ){ >+ if ( Log::Log4perl->get_logger('plack-intranet')->has_appenders ) { > enable 'Log4perl', category => 'plack-intranet'; > enable 'LogWarn'; > } > $intranet; > }; > mount '/api/v1/app.pl' => builder { >- if ( Log::Log4perl->get_logger('plack-api')->has_appenders ){ >+ if ( Log::Log4perl->get_logger('plack-api')->has_appenders ) { > enable 'Log4perl', category => 'plack-api'; > enable 'LogWarn'; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31729
:
141577
|
141578
|
141596
|
141597
|
141598
|
141714
|
141715
|
141716
|
142043
|
142044
|
142050
|
148600
|
148602
|
148603
|
148606
|
148612
|
148613
|
148720
|
154542
|
154601
|
154605
|
154676
|
154677