summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-03-16 03:30:48 +0100
committerGitHub <noreply@github.com>2018-03-16 03:30:48 +0100
commitb18915bb95c8b1fd9cf8ecef73f45cd47f71fc09 (patch)
tree45b99b30a6b86c51c1caf9e51cb9de563f42b287 /Bugzilla.pm
parent8a04bdd6bc2b5944a2d0bc5680f70829aa8115ce (diff)
downloadbugzilla-b18915bb95c8b1fd9cf8ecef73f45cd47f71fc09.tar.gz
bugzilla-b18915bb95c8b1fd9cf8ecef73f45cd47f71fc09.tar.xz
add Bugzilla->urlbase method that returns a URI object
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 3e969a99d..1ab72431a 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -59,6 +59,7 @@ use Safe;
use Sys::Syslog qw(:DEFAULT);
use List::Util qw(any);
use JSON::XS qw(decode_json);
+use URI;
use parent qw(Bugzilla::CPAN);
@@ -272,6 +273,13 @@ sub localconfig {
return $_[0]->process_cache->{localconfig} ||= read_localconfig();
}
+sub urlbase {
+ my ($class) = @_;
+
+ # Since this could be modified, we have to return a new one every time.
+ return URI->new($class->localconfig->{urlbase});
+}
+
sub params {
return $_[0]->request_cache->{params} ||= Bugzilla::Config::read_param_file();
}