*** Bug 17957 has been marked as a duplicate of this bug. ***
Created attachment 59512 [details] [review] Bug 17951: Make koha-create set template_cache_dir correctly This patch makes koha-create (and friends) handle the template_cache_dir config entry correctly. It does so by: - Adding a replaceable string to the template for koha-conf.xml - Making koha-create-dirs create the needed directories (i.e. /var/cache/koha/instance and /var/cache/koha/instance/templates) - Adding a --template-cache-dir switch to koha-create (so sysadmins can specify their favourite directory for the templates cache). - koha-remove now takes care of the instance's *templates* dir. - The install scripts now automatically create /var/cache/koha so it can be used later by koha-create and friends. It does so the same way it does for other install-created directories. To test, you should ideally be able to build your own packages. This instructions can be followed by people that doesn't have that ability yet. But can be used on a custom packages setup too. To test: - Make sure you have the latest misc4dev in your kohadevbox (if it is a fresh box you have it already) - Run: $ sudo perl misc4dev/cp_debian_files.pl - Manually create the /var/cache/koha dir (skip if you have your own packages): $ sudo mkdir /var/cache/koha - Create a new instance: $ sudo koha-create --create-db cachetest => SUCCESS: * /etc/koha/sites/cachetest/koha-conf.xml contains template_cache_dir and is populated with /var/cache/koha/cachetest/templates * The directory /var/cache/koha/cachetest/templates exists! - Create a new instance, pass your own cache dir: $ sudo koha-create --create-db --template-cache-dir /tmp cachetest2 => SUCCESS: etc/koha/sites/cachetest2/koha-conf.xml contains template_cache_dir and is populated with /tmp - Run: $ man koha-create => SUCCESS: The docs mention the --template-cache-dir option switch correctly. - Sign off :-D!
Works fine. Will be signing off tomorrow. And mentioning a few issues we might still consider.
Created attachment 62443 [details] [review] Bug 17951: Make koha-create set template_cache_dir correctly This patch makes koha-create (and friends) handle the template_cache_dir config entry correctly. It does so by: - Adding a replaceable string to the template for koha-conf.xml - Making koha-create-dirs create the needed directories (i.e. /var/cache/koha/instance and /var/cache/koha/instance/templates) - Adding a --template-cache-dir switch to koha-create (so sysadmins can specify their favourite directory for the templates cache). - koha-remove now takes care of the instance's *templates* dir. - The install scripts now automatically create /var/cache/koha so it can be used later by koha-create and friends. It does so the same way it does for other install-created directories. To test, you should ideally be able to build your own packages. This instructions can be followed by people that doesn't have that ability yet. But can be used on a custom packages setup too. To test: - Make sure you have the latest misc4dev in your kohadevbox (if it is a fresh box you have it already) - Run: $ sudo perl misc4dev/cp_debian_files.pl - Manually create the /var/cache/koha dir (skip if you have your own packages): $ sudo mkdir /var/cache/koha - Create a new instance: $ sudo koha-create --create-db cachetest => SUCCESS: * /etc/koha/sites/cachetest/koha-conf.xml contains template_cache_dir and is populated with /var/cache/koha/cachetest/templates * The directory /var/cache/koha/cachetest/templates exists! - Create a new instance, pass your own cache dir: $ sudo koha-create --create-db --template-cache-dir /tmp cachetest2 => SUCCESS: etc/koha/sites/cachetest2/koha-conf.xml contains template_cache_dir and is populated with /tmp - Run: $ man koha-create => SUCCESS: The docs mention the --template-cache-dir option switch correctly. - Sign off :-D! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Still want to mention: [1] Should koha-remove remove a custom template cache dir? It currently does not and this is consistent with the way we handle other dirs like uploads. Although template cache files are better candidates for immediate removal. [2] Should we somehow allow a user to say that he does not want template caching? I think that it is good to enable template caching by default now in packaging, but should we make it easier to disable it ?
Sounds like changes to etc/koha-conf.xml are missing.
(In reply to Jonathan Druart from comment #6) > Sounds like changes to etc/koha-conf.xml are missing. Ha, it is there
(In reply to Jonathan Druart from comment #6) > Sounds like changes to etc/koha-conf.xml are missing. Bug 7533?
(In reply to Tomás Cohen Arazi from comment #8) > (In reply to Jonathan Druart from comment #6) > > Sounds like changes to etc/koha-conf.xml are missing. > > Bug 7533? I do not understand what you are referring to. I am aware of bug 7533 as I wrote the patch for it. Apply the patch then compare etc/koha-conf.xml and debian/templates/koha-conf-site.xml.in, I think you will understand I am saying. Looking at bug 16083 it seems that we should continue to keep them in sync. Do not you think?
(In reply to Marcel de Rooy from comment #5) > Still want to mention: > > [1] Should koha-remove remove a custom template cache dir? It currently does > not and this is consistent with the way we handle other dirs like uploads. > Although template cache files are better candidates for immediate removal. I mimicked what is done with uploads. I think a custom dir shouldn't be removed. > [2] Should we somehow allow a user to say that he does not want template > caching? I think that it is good to enable template caching by default now > in packaging, but should we make it easier to disable it? If a user wants to disable template caching, they just need to comment out the relevant entry. But they will still get the warning in about.pl, that originally triggered me to write this patch to start with (i.e. we introduced something that will always warn the user if an entry is missing, and not add it automatically in the first place).
(In reply to Jonathan Druart from comment #9) > (In reply to Tomás Cohen Arazi from comment #8) > > (In reply to Jonathan Druart from comment #6) > > > Sounds like changes to etc/koha-conf.xml are missing. > > > > Bug 7533? > > I do not understand what you are referring to. I am aware of bug 7533 as I > wrote the patch for it. Yes, I misunderstood you at the beginning of this conversation. Sorry! > Apply the patch then compare etc/koha-conf.xml and > debian/templates/koha-conf-site.xml.in, I think you will understand I am > saying. I now understand you want koha-conf.xml to be filled with the same stuff, enabled by default, etc. > Looking at bug 16083 it seems that we should continue to keep them in sync. Wow, I always thought I was aware of developments in the install/CLI stuff, and now I know I'm not aware of all of them :-D > Do not you think? Yes, they should be in sync.
Created attachment 62690 [details] [review] 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>
Created attachment 68163 [details] [review] Bug 17951: Make koha-create set template_cache_dir correctly This patch makes koha-create (and friends) handle the template_cache_dir config entry correctly. It does so by: - Adding a replaceable string to the template for koha-conf.xml - Making koha-create-dirs create the needed directories (i.e. /var/cache/koha/instance and /var/cache/koha/instance/templates) - Adding a --template-cache-dir switch to koha-create (so sysadmins can specify their favourite directory for the templates cache). - koha-remove now takes care of the instance's *templates* dir. - The install scripts now automatically create /var/cache/koha so it can be used later by koha-create and friends. It does so the same way it does for other install-created directories. To test, you should ideally be able to build your own packages. This instructions can be followed by people that doesn't have that ability yet. But can be used on a custom packages setup too. To test: - Make sure you have the latest misc4dev in your kohadevbox (if it is a fresh box you have it already) - Run: $ sudo perl misc4dev/cp_debian_files.pl - Manually create the /var/cache/koha dir (skip if you have your own packages): $ sudo mkdir /var/cache/koha - Create a new instance: $ sudo koha-create --create-db cachetest => SUCCESS: * /etc/koha/sites/cachetest/koha-conf.xml contains template_cache_dir and is populated with /var/cache/koha/cachetest/templates * The directory /var/cache/koha/cachetest/templates exists! - Create a new instance, pass your own cache dir: $ sudo koha-create --create-db --template-cache-dir /tmp cachetest2 => SUCCESS: etc/koha/sites/cachetest2/koha-conf.xml contains template_cache_dir and is populated with /tmp - Run: $ man koha-create => SUCCESS: The docs mention the --template-cache-dir option switch correctly. - Sign off :-D! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 68164 [details] [review] 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>
Be careful that TT cache should not be enabled with Plack.
(In reply to Fridolin SOMERS from comment #15) > Be careful that TT cache should not be enabled with Plack. See IRC discussion. If possible, please report specific problems on using both. At this time its use is still recommended..
(In reply to Fridolin SOMERS from comment #15) > Be careful that TT cache should not be enabled with Plack. Could you be more specific?
(In reply to Jonathan Druart from comment #17) > (In reply to Fridolin SOMERS from comment #15) > > Be careful that TT cache should not be enabled with Plack. > > Could you be more specific? Sorry, i was wrong. I have found something odd with Plack but it is not linked to template_cache_dir. I will explain it in a mail.
Created attachment 70066 [details] [review] Bug 17951: Make koha-create set template_cache_dir correctly This patch makes koha-create (and friends) handle the template_cache_dir config entry correctly. It does so by: - Adding a replaceable string to the template for koha-conf.xml - Making koha-create-dirs create the needed directories (i.e. /var/cache/koha/instance and /var/cache/koha/instance/templates) - Adding a --template-cache-dir switch to koha-create (so sysadmins can specify their favourite directory for the templates cache). - koha-remove now takes care of the instance's *templates* dir. - The install scripts now automatically create /var/cache/koha so it can be used later by koha-create and friends. It does so the same way it does for other install-created directories. To test, you should ideally be able to build your own packages. This instructions can be followed by people that doesn't have that ability yet. But can be used on a custom packages setup too. To test: - Make sure you have the latest misc4dev in your kohadevbox (if it is a fresh box you have it already) - Run: $ sudo perl misc4dev/cp_debian_files.pl - Manually create the /var/cache/koha dir (skip if you have your own packages): $ sudo mkdir /var/cache/koha - Create a new instance: $ sudo koha-create --create-db cachetest => SUCCESS: * /etc/koha/sites/cachetest/koha-conf.xml contains template_cache_dir and is populated with /var/cache/koha/cachetest/templates * The directory /var/cache/koha/cachetest/templates exists! - Create a new instance, pass your own cache dir: $ sudo koha-create --create-db --template-cache-dir /tmp cachetest2 => SUCCESS: etc/koha/sites/cachetest2/koha-conf.xml contains template_cache_dir and is populated with /tmp - Run: $ man koha-create => SUCCESS: The docs mention the --template-cache-dir option switch correctly. - Sign off :-D! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 70067 [details] [review] 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>
Pushed to master for 18.05, thanks to everybody involved!
Enhancement, skipping for 17.11.x. Awesome work everybody!