From dbbeb6525b22b2ee49ed4458c4fc9fd61c9f4af2 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 9 May 2008 18:08:11 -0500 Subject: [PATCH] C4::Installer - new method to get available MARC frameworks For use by test suite; not a user-visible change. Signed-off-by: Joshua Ferraro --- C4/Installer.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/C4/Installer.pm b/C4/Installer.pm index a497b43fd3..25918c0adf 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -84,6 +84,30 @@ sub new { return $self; } +=head2 marcflavour_list + +=over 4 + +my ($marcflavours) = $installer->marcflavour_list($lang); + +=back + +Return a arrayref of the MARC flavour sets available for the +specified language C<$lang>. Returns 'undef' if a directory +for the language does not exist. + +=cut + +sub marcflavour_list { + my $self = shift; + my $lang = shift; + + my $dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/$lang/marcflavour"; + opendir(MYDIR, $dir) or return; + my @list = grep { !/^\.|CVS/ && -d "$dir/$_" } readdir(MYDIR); + closedir MYDIR; + return \@list; +} =head2 marc_framework_sql_list -- 2.39.5