[Rt-commit] r11891 - rt/branches/3.8-TESTING/lib/RT
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Fri Apr 25 05:04:37 EDT 2008
Author: sunnavy
Date: Fri Apr 25 05:04:34 2008
New Revision: 11891
Modified:
rt/branches/3.8-TESTING/lib/RT/Installer.pm
Log:
added CurrentValue(s) methods
Modified: rt/branches/3.8-TESTING/lib/RT/Installer.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Installer.pm (original)
+++ rt/branches/3.8-TESTING/lib/RT/Installer.pm Fri Apr 25 05:04:34 2008
@@ -8,7 +8,7 @@
Widget => '/Widgets/Form/Select',
WidgetArguments => {
Description => 'Type of the database where RT will store its data',
- Values => [
+ Values => [
grep {
my $m = 'DBD::' . $_;
$m->require ? 1 : 0
@@ -135,11 +135,31 @@
sub Meta {
my $class = shift;
- my $type = shift;
+ my $type = shift;
return $Meta{$type} if $type;
return \%Meta;
}
+sub CurrentValue {
+ my $class = shift;
+ my $type = shift;
+ $type = $class if !ref $class && $class && $class ne 'RT::Installer';
+
+ return undef unless $type;
+ return
+ $RT::Installer && exists $RT::Installer->{InstallConfig}{$type}
+ ? $RT::Installer->{InstallConfig}{$type}
+ : scalar RT->Config->Get($type);
+}
+
+sub CurrentValues {
+ my $class = shift;
+ my @types = @_;
+ push @types, $class if !ref $class && $class && $class ne 'RT::Installer';
+
+ return { map { $_ => CurrentValue($_ ) } @types };
+}
+
=head1 NAME
RT::Installer - RT's Installer
More information about the Rt-commit
mailing list