Bugzilla – Attachment 6618 Details for
Bug 7170
Remove use of XML::Simple
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7170: Remove XML::Simple usage in favour of YAML config file
Bug-7170-Remove-XMLSimple-usage-in-favour-of-YAML-.patch (text/plain), 1.85 KB, created by
Ian Walls
on 2011-12-06 21:27:10 UTC
(
hide
)
Description:
Bug 7170: Remove XML::Simple usage in favour of YAML config file
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2011-12-06 21:27:10 UTC
Size:
1.85 KB
patch
obsolete
>From e5809a9c481960c52fde68bcb4ecc661aed764ca Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >Date: Tue, 15 Nov 2011 12:48:43 -0500 >Subject: [PATCH] Bug 7170: Remove XML::Simple usage in favour of YAML config file > >Enables support for a YAML koha-conf file. >--- > C4/Context.pm | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 7581faa..301ec7f 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -84,6 +84,7 @@ BEGIN { > use DBI; > use ZOOM; > use XML::Simple; >+use YAML::Syck qw(LoadFile); > use C4::Boolean; > use C4::Debug; > use POSIX (); >@@ -169,7 +170,7 @@ environment variable to the pathname of a configuration file to use. > # > # The first entry that refers to a readable file is used. > >-use constant CONFIG_FNAME => "/etc/koha/koha-conf.xml"; >+use constant CONFIG_FNAME => "/etc/koha/koha-conf.yaml"; > # Default config file, if none is specified > > my $INSTALLED_CONFIG_FNAME = '__KOHA_CONF_DIR__/koha-conf.xml'; >@@ -232,6 +233,12 @@ sub read_config_file { # Pass argument naming config file to read > return $koha; # Return value: ref-to-hash holding the configuration > } > >+sub read_yaml_config_file { >+ my $koha; >+ $koha->{'config'} = YAML::Syck::LoadFile(shift); >+ return $koha; >+} >+ > # db_scheme2dbi > # Translates the full text name of a database into de appropiate dbi name > # >@@ -310,7 +317,11 @@ sub new { > } > } > # Load the desired config file. >- $self = read_config_file($conf_fname); >+ if ($conf_fname =~ /xml$/) { >+ $self = read_config_file($conf_fname); >+ } elsif ($conf_fname =~ /yaml$/) { >+ $self = read_yaml_config_file($conf_fname); >+ } > $self->{"config_file"} = $conf_fname; > > warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"}); >-- >1.7.2.5
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 7170
:
6618