From a2dd3b00284fd4724d3408274cb1156c7a77d187 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 24 Oct 2009 05:21:06 +0000 Subject: Bug 520948: Use Bugzilla->feature and feature_enabled everywhere instead of checking if modules are installed Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- jsonrpc.cgi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 jsonrpc.cgi (limited to 'jsonrpc.cgi') diff --git a/jsonrpc.cgi b/jsonrpc.cgi old mode 100644 new mode 100755 index cd41663fa..25fb4c175 --- a/jsonrpc.cgi +++ b/jsonrpc.cgi @@ -27,10 +27,12 @@ use Bugzilla; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::WebService::Constants; -# This eval allows runtests to pass even if JSON::RPC isn't -# installed. +if (!Bugzilla->feature('jsonrpc')) { + ThrowCodeError('feature_disabled', { feature => 'jsonrpc' }); +} + +# This eval allows runtests.pl to pass. eval { require Bugzilla::WebService::Server::JSONRPC; }; -$@ && ThrowCodeError('json_rpc_not_installed'); Bugzilla->usage_mode(USAGE_MODE_JSON); -- cgit v1.2.1