aboutsummaryrefslogtreecommitdiffstats
path: root/jsonrpc.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-10-24 05:21:06 +0000
committermkanat%bugzilla.org <>2009-10-24 05:21:06 +0000
commita2dd3b00284fd4724d3408274cb1156c7a77d187 (patch)
tree4aa41a1c8cea9d31aaccddc4685f8f1c5991c1b4 /jsonrpc.cgi
parent401fb65f2e6f9031cedf47fb6d951236b5c624d3 (diff)
downloadbugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar
bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.gz
bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.bz2
bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.xz
bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.zip
Bug 520948: Use Bugzilla->feature and feature_enabled everywhere instead of checking if modules are installed
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'jsonrpc.cgi')
-rwxr-xr-x[-rw-r--r--]jsonrpc.cgi8
1 files changed, 5 insertions, 3 deletions
diff --git a/jsonrpc.cgi b/jsonrpc.cgi
index cd41663fa..25fb4c175 100644..100755
--- 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);