[Koha-patches] [PATCH] Updating the Makefile so memcached configuration can be added to the koha-conf.xml file
Chris Cormack
chris at bigballofwax.co.nz
Mon Aug 24 10:49:11 CEST 2009
---
Makefile.PL | 25 +++++++++++++++++++++++++
etc/koha-conf.xml | 2 ++
rewrite-config.PL | 3 ++-
3 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index a3775f0..e5c1e79 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -413,6 +413,9 @@ my %config_defaults = (
'PAZPAR2_PORT' => '11002',
'RUN_DATABASE_TESTS' => 'no',
'PATH_TO_ZEBRA' => '',
+ 'USE_MEMCACHED' => 'no',
+ 'MEMCACHED_SERVERS' => '127.0.0.1:11211',
+ 'MEMCACHED_NAMESPACE' => 'KOHA'
);
# set some default configuration options based on OS
@@ -449,6 +452,7 @@ my %valid_config_values = (
'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
'ZEBRA_LANGUAGE' => { 'en' => 1, 'fr' => 1 }, # FIXME should generate from contents of distribution
'RUN_DATABASE_TESTS' => { 'yes' => 1, 'no' => 1 },
+ 'USE_MEMCACHED' => { 'yes' => 1, 'no' => 1 },
);
# get settings from command-line
@@ -577,6 +581,7 @@ WriteMakefile(
'MIME::Lite' => 3.00,
'MIME::QuotedPrint' => 3.07,
'Mail::Sendmail' => 0.79,
+ 'Memoize::Memcached' => 0.03, # optional
'Net::LDAP' => 0.33, # optional
'Net::LDAP::Filter' => 0.14, # optional
'Net::Z3950::ZOOM' => 1.16,
@@ -1083,6 +1088,26 @@ PazPar2 port?);
}
}
+ $msg = q(
+Use memcached and memoize to cache the results of some function calls?
+This provides a signficant performance improvement.
+You will need a Memcached server running.);
+ $msg .= _add_valid_values_disp('USE_MEMCACHED', $valid_values);
+ $config{'USE_MEMCACHED'} = _get_value('USE_MEMCACHED', $msg, $defaults->{'USE_MEMCACHED'}, $valid_values, $install_log_values);
+ if ($config{'USE_MEMCACHED'} eq 'yes'){
+ $msg = q(
+Since you've chosen to use caching, you must specify the memcached servers and the namespace to use:
+);
+ $msg = q(
+Memcached server address?);
+ $config{'MEMCACHED_SERVERS'} = _get_value('MEMCACHED_SERVERS', $msg, $defaults->{'MEMCACHED_SERVERS'}, $valid_values, $install_log_values);
+
+ $msg = q(
+Memcached namespace?);
+ $config{'MEMCACHED_NAMESPACE'} = _get_value('MEMCACHED_NAMESPACE', $msg, $defaults->{'MEMCACHED_NAMESPACE'}, $valid_values, $install_log_values);
+ }
+
+
$msg = q(
Would you like to run the database-dependent test suite?);
diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml
index e627fc6..3feb98e 100644
--- a/etc/koha-conf.xml
+++ b/etc/koha-conf.xml
@@ -191,5 +191,7 @@ __PAZPAR2_TOGGLE_XML_POST__
<pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url>
<install_log>__MISC_DIR__/koha-install-log</install_log>
<useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
+ <memcached_servers>__MEMCACHED_SERVERS__</memcached_servers>
+ <memcached_namespace>__MEMCACHED_NAMESPACE__</memcached_namespace>
</config>
</yazgfs>
diff --git a/rewrite-config.PL b/rewrite-config.PL
index 9caadf1..9009eb5 100644
--- a/rewrite-config.PL
+++ b/rewrite-config.PL
@@ -137,6 +137,8 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr";
"__AUTH_INDEX_MODE__" => 'grs1',
"__RUN_DATABASE_TESTS__" => 'no',
"__PATH_TO_ZEBRA__" => "",
+ "__MEMCACHED_SERVERS__" => "",
+ "__MEMCACHED_NAMESPACE__" => "",
);
# Override configuration from the environment
@@ -192,4 +194,3 @@ Makefile.PL, ExtUtils::MakeMaker(3)
MJ Ray mjr at phonecoop.coop
=cut
-
--
1.6.0.4
More information about the Koha-patches
mailing list