Bugzilla – Attachment 78544 Details for
Bug 21327
Add a Modular Koha Core design
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add Core::Main Namespace
Add-CoreMain-Namespace.patch (text/plain), 4.04 KB, created by
Benjamin Rokseth
on 2018-09-10 19:10:28 UTC
(
hide
)
Description:
Add Core::Main Namespace
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2018-09-10 19:10:28 UTC
Size:
4.04 KB
patch
obsolete
>From 6d7006545a7c1ccba7024e547a798fd5c6b67854 Mon Sep 17 00:00:00 2001 >From: Benjamin Rokseth <benjamin.rokseth@deichman.no> >Date: Sun, 9 Sep 2018 23:15:24 +0200 >Subject: [PATCH] Add Core::Main Namespace > >- Core::Exceptions >- Core::Prefs > >This is the main class of Core, along with siblings >Prefs, to handle sysprefs and overrides, as well as >Exceptions. Also included are the Makefile and koha-conf setup > >https://bugs.koha-community.org/show_bug.cgi?id=21327 >--- > Core/Exceptions.pm | 21 +++++++++++++++++++++ > Core/Main.pm | 12 ++++++++++++ > Core/Prefs.pm | 30 ++++++++++++++++++++++++++++++ > Makefile.PL | 1 + > debian/templates/koha-conf-site.xml.in | 5 ++++- > etc/koha-conf.xml | 5 ++++- > 6 files changed, 72 insertions(+), 2 deletions(-) > create mode 100644 Core/Exceptions.pm > create mode 100644 Core/Main.pm > create mode 100644 Core/Prefs.pm > >diff --git a/Core/Exceptions.pm b/Core/Exceptions.pm >new file mode 100644 >index 0000000..a1a8b17 >--- /dev/null >+++ b/Core/Exceptions.pm >@@ -0,0 +1,21 @@ >+package Core::Exceptions; >+ >+use Modern::Perl; >+ >+use Exception::Class ( >+ "Core::Exception::Circulation", >+ "Core::Exception::Circulation::CheckinError" => { >+ description => "Error checking in", >+ isa => "Core::Exception::Circulation", >+ }, >+ "Core::Exception::Circulation::CheckoutError" => { >+ description => "Error checking out", >+ isa => "Core::Exception::Circulation", >+ }, >+ "Core::Exception::Circulation::RenewError" => { >+ description => "Error renewing item", >+ isa => "Core::Exception::Circulation", >+ } >+); >+ >+1; >diff --git a/Core/Main.pm b/Core/Main.pm >new file mode 100644 >index 0000000..b5e1940 >--- /dev/null >+++ b/Core/Main.pm >@@ -0,0 +1,12 @@ >+package Core::Main; >+ >+use strict; >+use warnings; >+ >+sub new { >+ >+ my $class = shift; >+ return bless {}, $class; >+} >+ >+1; >diff --git a/Core/Prefs.pm b/Core/Prefs.pm >new file mode 100644 >index 0000000..9927656 >--- /dev/null >+++ b/Core/Prefs.pm >@@ -0,0 +1,30 @@ >+package Core::Prefs; >+ >+use strict; >+use warnings; >+ >+use Carp; >+use Koha::Config::SysPrefs; >+ >+=head >+ args: systempreference overrides >+=cut >+sub new { >+ my ($class, $args) = @_; >+ >+ my $self = {}; >+ my $prefs; >+ my $tmp = Koha::Config::SysPrefs->search->unblessed; >+ foreach (@$tmp) { >+ $prefs->{$_->{variable}} = $_->{value}; >+ } >+ $args ||= {}; >+ $self->{prefs} = { >+ %$prefs, >+ %$args, >+ }; >+ >+ bless $self, $class; >+} >+ >+1; >diff --git a/Makefile.PL b/Makefile.PL >index ada08b9..ba90164 100644 >--- a/Makefile.PL >+++ b/Makefile.PL >@@ -303,6 +303,7 @@ my $target_map = { > './check_sysprefs.pl' => 'NONE', > './circ' => 'INTRANET_CGI_DIR', > './clubs' => 'INTRANET_CGI_DIR', >+ './Core' => 'PERL_MODULE_DIR', > './course_reserves' => 'INTRANET_CGI_DIR', > './docs/history.txt' => { target => 'DOC_DIR', trimdir => -1 }, > './offline_circ' => 'INTRANET_CGI_DIR', >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index e6982bb..357cb8a 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -382,6 +382,9 @@ __END_SRU_PUBLICSERVER__ > instance to be something other then the local timezone of the > server. e.g. Antarctica/South_Pole --> > <timezone>__TIMEZONE__</timezone> >- >+ <core_modules> >+ <circulation>Core::Community::Circulation</circulation> >+ <sip>Core::Community::Circulation::SIP</sip> >+ </core_modules> > </config> > </yazgfs> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 4af100e..0fae993 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -198,6 +198,9 @@ __PAZPAR2_TOGGLE_XML_POST__ > instance to be something other then the local timezone of the > server. e.g. Antarctica/South_Pole --> > <timezone></timezone> >- >+ <core_modules> >+ <circulation>Core::Community::Circulation</circulation> >+ <sip>Core::Community::Circulation::SIP</sip> >+ </core_modules> > </config> > </yazgfs> >-- >2.1.4
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 21327
:
78544
|
78545
|
78546
|
78547
|
78549
|
78550
|
78551
|
78552