Bugzilla – Attachment 70067 Details for
Bug 17951
koha-create should create the template cache dir and configure it in koha-conf.xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17951: (followup) Make Makefile.PL handle template_cache_dir config
Bug-17951-followup-Make-MakefilePL-handle-template.patch (text/plain), 5.24 KB, created by
Kyle M Hall (khall)
on 2017-12-21 16:18:57 UTC
(
hide
)
Description:
Bug 17951: (followup) Make Makefile.PL handle template_cache_dir config
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-12-21 16:18:57 UTC
Size:
5.24 KB
patch
obsolete
>From 8f38f1f420af537ec1caa83ce18c4670f3f3b9e4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 25 Apr 2017 12:25:32 -0300 >Subject: [PATCH] Bug 17951: (followup) Make Makefile.PL handle > template_cache_dir config > >This patch adds Makefile.PL the capability of handling the template_cache_dir configuration entry. >To do so, it: >- Adds the --template-cache-dir option switch (consistency with koha-create) >- Sets a default value for template_cache_dir to '/tmp/koha' >- Adds a dialog requesting the path for the template cache dir to Makefile.PL >- It tweaks etc/koha-conf.xml so it is correctly changed by rewrite-config.PL > >To test: >- Apply this patch >- Run: > $ perl Makefile.PL --template-cache-dir your/favourite/dir >=> SUCCESS: The dialogs don't ask for template cache dir >=> SUCCESS: The resulting Makefile contains an entry for TEMPLATE_CACHE_DIR which value > matches what we passed to --template-cache-dir >- Run: > $ perl Makefile.PL >- When prompted for a template cache dir, introduce whatever you want >=> SUCCESS: The default you are offered is /tmp/koha >=> SUCCESS: At the end of the process, Makefile contains what we put in there >- Run: > $ sudo make install >=> SUCCESS: The resulting koha-conf.xml contains a <template_cache_dir> entry containing > whatever you picked for that purpose. >- Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Makefile.PL | 11 ++++++++++- > etc/koha-conf.xml | 5 +---- > rewrite-config.PL | 1 + > 3 files changed, 12 insertions(+), 5 deletions(-) > >diff --git a/Makefile.PL b/Makefile.PL >index ada4224..ecd4297 100644 >--- a/Makefile.PL >+++ b/Makefile.PL >@@ -101,6 +101,7 @@ Makefile.PL - Koha packager and installer > --font_dir Location of fonts (e.g. /usr/share/fonts/truetype/ttf-dejavu) > --run_database_tests Run database dependent tests (yes, no) > --install_base Base directory of installation (e.g. /usr/share/koha) >+ --template-cache-dir Specify a template cache directory (e.g. /var/cache/koha) > --help Display this help message > > =head1 DESCRIPTION >@@ -485,6 +486,7 @@ my %config_defaults = ( > 'USE_MEMCACHED' => 'no', > 'MEMCACHED_SERVERS' => '127.0.0.1:11211', > 'MEMCACHED_NAMESPACE' => 'KOHA', >+ 'TEMPLATE_CACHE_DIR' => '/tmp/koha', > 'FONT_DIR' => '/usr/share/fonts/truetype/ttf-dejavu' > ); > >@@ -546,6 +548,7 @@ my $cli_koha_use_memcached = ""; > my $cli_koha_font_dir = ""; > my $cli_koha_run_database_tests = ""; > my $cli_koha_install_base = ""; >+my $cli_koha_template_cache_dir = ""; > Getopt::Long::Configure('pass_through'); > my $results = GetOptions( > "prev-install-log=s" => \$koha_install_log, >@@ -574,6 +577,7 @@ my $results = GetOptions( > "font_dir=s" => \$cli_koha_font_dir, > "run_database_tests=s" => \$cli_koha_run_database_tests, > "install_base=s" => \$cli_koha_install_base, >+ "template-cache-dir=s" => \$cli_koha_template_cache_dir, > "help" => sub { HelpMessage(0) }, > ) or HelpMessage(1); > >@@ -861,7 +865,8 @@ sub get_cli_values { > USE_MEMCACHED => $cli_koha_use_memcached, > FONT_DIR => $cli_koha_font_dir, > RUN_DATABASE_TESTS => $cli_koha_run_database_tests, >- INSTALL_BASE => $cli_koha_install_base >+ INSTALL_BASE => $cli_koha_install_base, >+ TEMPLATE_CACHE_DIR => $cli_koha_template_cache_dir > }; > foreach my $key (keys %{$map}) { > $values->{$key} = $map->{$key} if ($map->{$key}); >@@ -1242,6 +1247,10 @@ Memcached namespace?); > } > > $msg = q( >+Template cache directory?); >+ $config{'TEMPLATE_CACHE_DIR'} = _get_value('TEMPLATE_CACHE_DIR', $msg, $defaults->{'TEMPLATE_CACHE_DIR'}, $valid_values, $install_log_values); >+ >+ $msg = q( > Path to DejaVu fonts?); > $config{'FONT_DIR'} = _get_value('FONT_DIR', $msg, $defaults->{'FONT_DIR'}, $valid_values, $install_log_values); > >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 067e978..268175d 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -122,10 +122,7 @@ __PAZPAR2_TOGGLE_XML_POST__ > <log4perl_conf>__KOHA_CONF_DIR__/log4perl.conf</log4perl_conf> > <memcached_servers>__MEMCACHED_SERVERS__</memcached_servers> > <memcached_namespace>__MEMCACHED_NAMESPACE__</memcached_namespace> >- <!-- Uncomment the following line if you want to use template caching >- That will bring a performance boost >- <template_cache_dir>/tmp</template_cache_dir> >- --> >+ <template_cache_dir>__TEMPLATE_CACHE_DIR__</template_cache_dir> > > <!-- Secret passphrase used by Mojolicious for signed cookies --> > <api_secret_passphrase>CHANGEME</api_secret_passphrase> >diff --git a/rewrite-config.PL b/rewrite-config.PL >index d827106..5366493 100644 >--- a/rewrite-config.PL >+++ b/rewrite-config.PL >@@ -153,6 +153,7 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr"; > "__MEMCACHED_SERVERS__" => "", > "__MEMCACHED_NAMESPACE__" => "", > "__FONT_DIR__" => "/usr/share/fonts/truetype/ttf-dejavu", >+ "__TEMPLATE_CACHE_DIR__" => "/tmp/koha" > ); > > # Override configuration from the environment >-- >2.10.2
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 17951
:
59512
|
62443
|
62690
|
68163
|
68164
|
70066
| 70067