Bugzilla – Attachment 167436 Details for
Bug 31109
Prevent overwriting bibliographic records in case of simultaneous modification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31109: Koha::Util::Misc - utility class with miscellaneous routines
Bug-31109-KohaUtilMisc---utility-class-with-miscel.patch (text/plain), 2.01 KB, created by
Janusz Kaczmarek
on 2024-06-05 11:32:32 UTC
(
hide
)
Description:
Bug 31109: Koha::Util::Misc - utility class with miscellaneous routines
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-06-05 11:32:32 UTC
Size:
2.01 KB
patch
obsolete
>From 30836a394d0736521e8f8eb89b42d18e186d2bd9 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Mon, 3 Jun 2024 12:30:34 +0000 >Subject: [PATCH] Bug 31109: Koha::Util::Misc - utility class with > miscellaneous routines > >New module with only one function now: digest -- to calculate a md5_hex >digest of the given argument (any Perl data structure). >--- > Koha/Util/Misc.pm | 56 +++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > create mode 100644 Koha/Util/Misc.pm > >diff --git a/Koha/Util/Misc.pm b/Koha/Util/Misc.pm >new file mode 100644 >index 0000000000..416d5fe40f >--- /dev/null >+++ b/Koha/Util/Misc.pm >@@ -0,0 +1,56 @@ >+package Koha::Util::Misc; >+ >+# Copyright 2024 Koha Development Team >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Digest::MD5 qw( md5_hex ); >+use Sereal::Encoder qw( encode_sereal ); >+ >+use Exporter 'import'; >+ >+BEGIN { >+ our @EXPORT_OK = qw( digest ); >+} >+ >+=head1 NAME >+ >+Koha::Util::Misc - utility class with miscellaneous routines >+ >+=head1 METHODS >+ >+=head2 digest >+ >+Calculates a md5_hex digest of the given argument (any Perl data structure). >+ >+=cut >+ >+sub digest { >+ my $data = shift; >+ return md5_hex( encode_sereal( ( ref $data eq '' ) ? \$data : $data, { sort_keys => 1 } ) ); >+} >+ >+1; >+__END__ >+ >+=head1 AUTHOR >+ >+Koha Development Team <http://koha-community.org/> >+ >+Janusz Kaczmarek <januszop@gmail.com> >+ >+=cut >-- >2.39.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 31109
:
139046
|
167192
|
167373
|
167374
|
167375
|
167415
|
167416
|
167417
|
167436
|
167437
|
167438
|
167439
|
167492
|
167493
|
167494
|
168352
|
168353
|
168354
|
168472
|
168473
|
168474