diff options
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r-- | Bugzilla.pm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 7c52dd500..32f731859 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -327,6 +327,28 @@ sub usage_mode { || Bugzilla::Constants::USAGE_MODE_BROWSER; } +sub installation_mode { + my ($class, $newval) = @_; + ($class->request_cache->{installation_mode} = $newval) if defined $newval; + return $class->request_cache->{installation_mode} + || INSTALLATION_MODE_INTERACTIVE; +} + +sub installation_answers { + my ($class, $filename) = @_; + if ($filename) { + my $s = new Safe; + $s->rdo($filename); + + die "Error reading $filename: $!" if $!; + die "Error evaluating $filename: $@" if $@; + + # Now read the param back out from the sandbox + $class->request_cache->{installation_answers} = $s->varglob('answer'); + } + return $class->request_cache->{installation_answers} || {}; +} + sub switch_to_shadow_db { my $class = shift; @@ -570,6 +592,16 @@ usage mode. C<Bugzilla->usage_mode> will return the current state of this flag. +=item C<installation_mode> + +Determines whether or not installation should be silent. See +L<Bugzilla::Constants> for the C<INSTALLATION_MODE> constants. + +=item C<installation_answers> + +Returns a hashref representing any "answers" file passed to F<checksetup.pl>, +used to automatically answer or skip prompts. + =item C<dbh> The current database handle. See L<DBI>. |