Bugzilla – Attachment 33829 Details for
Bug 11998
Syspref caching issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11998 - tidy up the Koha::Config::SystemPreferences module a bit
Bug-11998---tidy-up-the-KohaConfigSystemPreference.patch (text/plain), 5.51 KB, created by
Robin Sheat
on 2014-11-24 03:52:24 UTC
(
hide
)
Description:
Bug 11998 - tidy up the Koha::Config::SystemPreferences module a bit
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2014-11-24 03:52:24 UTC
Size:
5.51 KB
patch
obsolete
>From 96dcdfa3d65b968620f2cbef6a7821c5f8b144e5 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Mon, 24 Nov 2014 16:34:50 +1300 >Subject: [PATCH] Bug 11998 - tidy up the Koha::Config::SystemPreferences > module a bit > >--- > C4/Context.pm | 1 - > C4/LogStatic.pm | 96 ----------------------------------------- > Koha/Config/SystemPreference.pm | 56 ++++++++++++++++++++++++ > 3 files changed, 56 insertions(+), 97 deletions(-) > delete mode 100644 C4/LogStatic.pm > >diff --git a/C4/Context.pm b/C4/Context.pm >index d5bab4d..ac7d6bd 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -105,7 +105,6 @@ use ZOOM; > use XML::Simple; > use C4::Boolean; > use C4::Debug; >-use C4::LogStatic qw/ logaction /; > use Koha::Cache; > use POSIX (); > use DateTime::TimeZone; >diff --git a/C4/LogStatic.pm b/C4/LogStatic.pm >deleted file mode 100644 >index 7cb1de2..0000000 >--- a/C4/LogStatic.pm >+++ /dev/null >@@ -1,96 +0,0 @@ >-package C4::LogStatic; >- >-# This is a very simple logging system, designed to be only used in >-# circumstances where C4::Context can't be loaded. Typically, this is >-# only in C4::Context itself. >-# >-# This is intended to be temporary until C4::Context gets refactored to not >-# handle things like sysprefs that need logged about. >- >- >-# Copyright 2000-2002 Katipo Communications >-# Copyright 2011 MJ Ray and software.coop >-# Copyright 2014 Catalyst IT >-# >-# 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 2 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, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >- >-use strict; >-use warnings; >- >-use vars qw($VERSION @ISA @EXPORT); >- >-BEGIN { >- # set the version for version checking >- $VERSION = 3.07.00.049; >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT = qw(&logaction); >-} >- >-=head1 NAME >- >-C4::LogStatic - basic logging function for Koha. >- >-=head1 SYNOPSIS >- >- use C4::LogStatic; >- logaction($dbh, $userenv, "module", "action", $objectnum, "what happened"); >- >-=head1 DESCRIPTION >- >-This allows simple logging in situtations where C4::Context can't be loaded. >- >-=head1 FUNCTIONS >- >-=over 2 >- >-=item logaction >- >- logaction($dbh, $userenv, $modulename, $actionname, $objectnumber, $infos); >- >-Adds a record into action_logs table to report the different changes upon the database. >-Each log entry includes the number of the user currently logged in. For batch >-jobs, which operate without authenticating a user and setting up a session, the user >-number is set to 0, which is the same as the superlibrarian's number. >- >-=cut >- >-#' >-sub logaction { >- my ($dbh, $userenv, $modulename, $actionname, $objectnumber, $infos)=@_; >- >- # Get ID of logged in user. if called from a batch job, >- # no user session exists and C4::Context->userenv() returns >- # the scalar '0'. >- my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0; >- $usernumber ||= 0; >- >- my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)"); >- $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos); >- $sth->finish; >-} >- >- >-1; >-__END__ >- >-=back >- >-=head1 AUTHOR >- >-Koha Development Team <http://koha-community.org/> >- >-=cut >diff --git a/Koha/Config/SystemPreference.pm b/Koha/Config/SystemPreference.pm >index 791fe44..085084a 100644 >--- a/Koha/Config/SystemPreference.pm >+++ b/Koha/Config/SystemPreference.pm >@@ -1,5 +1,61 @@ > package Koha::Config::SystemPreference; > >+# Copyright 2014 Biblibre >+# Copyright 2014 Catalyst IT >+# >+# 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, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+=head1 NAME >+ >+Koha::Config::SystemPreference - provides a simple interface to the system preference database >+ >+=head1 SYNOPSIS >+ >+ use Koha::Config::SystemPreference; >+ my $set = Koha::Config::SystemPreference::set( $var, $value, $expl, $type, $options ); >+ my $deleted = Koha::Config::SystemPreference::delete($var); >+ >+=head1 NOTE >+ >+This has little documentation, and doesn't provide some obvious functions, this >+is because it has a TODO list: >+ >+=over 4 >+ >+=item >+ >+Re-implement in an OO way >+ >+=item >+ >+Handle caching here >+ >+=item >+ >+Complete documentation (when re-written) >+ >+=item >+ >+Move other functions in Koha to reference this rather than the functions >+in C4::Context for working with preferences. >+ >+=back >+ >+=cut >+ > use Koha::Database; > use C4::Log qw( logaction ); > >-- >1.9.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 11998
:
26575
|
26621
|
26714
|
26716
|
26717
|
27382
|
31801
|
31802
|
32870
|
32871
|
32872
|
32873
|
32874
|
33183
|
33447
|
33670
|
33671
|
33685
|
33724
|
33725
|
33746
|
33829
|
33940
|
36523
|
36524
|
36525
|
36526
|
36527
|
36528
|
36529
|
36530
|
36531
|
36532
|
36533
|
36534
|
36571
|
36583
|
36584
|
36585
|
36586
|
36587
|
36588
|
36589
|
36590
|
36591
|
36592
|
36593
|
36594
|
36595
|
48640
|
48652
|
48655
|
48687
|
48688
|
48727
|
48758
|
48928
|
48929
|
48930
|
48931
|
48932
|
48933
|
48934
|
48935
|
48936
|
48961
|
49022
|
49023
|
49024
|
49025
|
49026
|
49027
|
49028
|
49029
|
49030
|
49100
|
49101
|
49102
|
49103
|
49104
|
49105
|
49106
|
49107
|
49108