Bugzilla – Attachment 111365 Details for
Bug 26625
Add ability to configure mojolicious applications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26625: (alternative) Use Config plugin in Mojolicious apps
Bug-26625-alternative-Use-Config-plugin-in-Mojolic.patch (text/plain), 2.22 KB, created by
Julian Maurice
on 2020-10-08 06:44:26 UTC
(
hide
)
Description:
Bug 26625: (alternative) Use Config plugin in Mojolicious apps
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-10-08 06:44:26 UTC
Size:
2.22 KB
patch
obsolete
>From c9c66cf4207bd83e7760d01594d855f8254093d9 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 8 Oct 2020 08:39:16 +0200 >Subject: [PATCH] Bug 26625: (alternative) Use Config plugin in Mojolicious > apps > >This allows to have separate config files for each mojolicious app. They >can also both use the same config file. >The config file is Perl code, so the configuration can be dynamic > >See https://docs.mojolicious.org/Mojolicious/Plugin/Config >--- > Koha/App/Intranet.pm | 4 ++++ > Koha/App/Opac.pm | 4 ++++ > etc/koha-mojolicious.conf | 9 +++++++++ > 3 files changed, 17 insertions(+) > create mode 100644 etc/koha-mojolicious.conf > >diff --git a/Koha/App/Intranet.pm b/Koha/App/Intranet.pm >index bf66e9e62b..2595d576ef 100644 >--- a/Koha/App/Intranet.pm >+++ b/Koha/App/Intranet.pm >@@ -27,6 +27,10 @@ use Koha::Cache::Memory::Lite; > sub startup { > my ($self) = @_; > >+ # Setting a default config to avoid errors if the config file is missing >+ # Set MOJO_CONFIG environment variable to define the config file path >+ $self->plugin('Config', { default => {} }); >+ > push @{$self->plugins->namespaces}, 'Koha::App::Plugin'; > push @{$self->static->paths}, $self->home->rel_file('koha-tmpl'); > >diff --git a/Koha/App/Opac.pm b/Koha/App/Opac.pm >index 7af85e1515..54b04203ca 100644 >--- a/Koha/App/Opac.pm >+++ b/Koha/App/Opac.pm >@@ -27,6 +27,10 @@ use Koha::Cache::Memory::Lite; > sub startup { > my ($self) = @_; > >+ # Setting a default config to avoid errors if the config file is missing >+ # Set MOJO_CONFIG environment variable to define the config file path >+ $self->plugin('Config', { default => {} }); >+ > push @{$self->plugins->namespaces}, 'Koha::App::Plugin'; > push @{$self->static->paths}, $self->home->rel_file('koha-tmpl'); > >diff --git a/etc/koha-mojolicious.conf b/etc/koha-mojolicious.conf >new file mode 100644 >index 0000000000..b66f032e4d >--- /dev/null >+++ b/etc/koha-mojolicious.conf >@@ -0,0 +1,9 @@ >+# Example of config file for mojolicious applications >+# https://docs.mojolicious.org/Mojolicious/Plugin/Config >+{ >+ # Hypnotoad settings >+ # https://metacpan.org/pod/Mojo::Server::Hypnotoad#SETTINGS >+ hypnotoad => { >+ listen => ['http://*:8000'], >+ }, >+} >-- >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 26625
:
111323
| 111365