|
Lines 84-89
BEGIN {
Link Here
|
| 84 |
use DBI; |
84 |
use DBI; |
| 85 |
use ZOOM; |
85 |
use ZOOM; |
| 86 |
use XML::Simple; |
86 |
use XML::Simple; |
|
|
87 |
use YAML::Syck qw(LoadFile); |
| 87 |
use C4::Boolean; |
88 |
use C4::Boolean; |
| 88 |
use C4::Debug; |
89 |
use C4::Debug; |
| 89 |
use POSIX (); |
90 |
use POSIX (); |
|
Lines 169-175
environment variable to the pathname of a configuration file to use.
Link Here
|
| 169 |
# |
170 |
# |
| 170 |
# The first entry that refers to a readable file is used. |
171 |
# The first entry that refers to a readable file is used. |
| 171 |
|
172 |
|
| 172 |
use constant CONFIG_FNAME => "/etc/koha/koha-conf.xml"; |
173 |
use constant CONFIG_FNAME => "/etc/koha/koha-conf.yaml"; |
| 173 |
# Default config file, if none is specified |
174 |
# Default config file, if none is specified |
| 174 |
|
175 |
|
| 175 |
my $INSTALLED_CONFIG_FNAME = '__KOHA_CONF_DIR__/koha-conf.xml'; |
176 |
my $INSTALLED_CONFIG_FNAME = '__KOHA_CONF_DIR__/koha-conf.xml'; |
|
Lines 232-237
sub read_config_file { # Pass argument naming config file to read
Link Here
|
| 232 |
return $koha; # Return value: ref-to-hash holding the configuration |
233 |
return $koha; # Return value: ref-to-hash holding the configuration |
| 233 |
} |
234 |
} |
| 234 |
|
235 |
|
|
|
236 |
sub read_yaml_config_file { |
| 237 |
my $koha; |
| 238 |
$koha->{'config'} = YAML::Syck::LoadFile(shift); |
| 239 |
return $koha; |
| 240 |
} |
| 241 |
|
| 235 |
# db_scheme2dbi |
242 |
# db_scheme2dbi |
| 236 |
# Translates the full text name of a database into de appropiate dbi name |
243 |
# Translates the full text name of a database into de appropiate dbi name |
| 237 |
# |
244 |
# |
|
Lines 310-316
sub new {
Link Here
|
| 310 |
} |
317 |
} |
| 311 |
} |
318 |
} |
| 312 |
# Load the desired config file. |
319 |
# Load the desired config file. |
| 313 |
$self = read_config_file($conf_fname); |
320 |
if ($conf_fname =~ /xml$/) { |
|
|
321 |
$self = read_config_file($conf_fname); |
| 322 |
} elsif ($conf_fname =~ /yaml$/) { |
| 323 |
$self = read_yaml_config_file($conf_fname); |
| 324 |
} |
| 314 |
$self->{"config_file"} = $conf_fname; |
325 |
$self->{"config_file"} = $conf_fname; |
| 315 |
|
326 |
|
| 316 |
warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"}); |
327 |
warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"}); |
| 317 |
- |
|
|