summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-10-19 14:58:48 +0200
committermkanat%bugzilla.org <>2007-10-19 14:58:48 +0200
commit77761cd6861490775d0d617f962ad213019517d9 (patch)
treedd220626d75c0c22afb2c2bd25c5d06a53f5d260 /extensions
parent415e32d463bbb881d991d886ddba6f859669c098 (diff)
downloadbugzilla-77761cd6861490775d0d617f962ad213019517d9.tar.gz
bugzilla-77761cd6861490775d0d617f962ad213019517d9.tar.xz
Bug 396243: Allow extensions (aka plugins) to extend the WebService interface
This also includes the first checkin of the example plugin. Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=ghendricks, a=mkanat
Diffstat (limited to 'extensions')
-rw-r--r--extensions/example/code/webservice.pl5
-rw-r--r--extensions/example/disabled0
-rw-r--r--extensions/example/lib/WSExample.pm10
3 files changed, 15 insertions, 0 deletions
diff --git a/extensions/example/code/webservice.pl b/extensions/example/code/webservice.pl
new file mode 100644
index 000000000..cf608c0e2
--- /dev/null
+++ b/extensions/example/code/webservice.pl
@@ -0,0 +1,5 @@
+use strict;
+use warnings;
+use Bugzilla;
+my $dispatch = Bugzilla->hook_args->{dispatch};
+$dispatch->{Example} = "extensions::example::lib::WSExample";
diff --git a/extensions/example/disabled b/extensions/example/disabled
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/extensions/example/disabled
diff --git a/extensions/example/lib/WSExample.pm b/extensions/example/lib/WSExample.pm
new file mode 100644
index 000000000..05975b874
--- /dev/null
+++ b/extensions/example/lib/WSExample.pm
@@ -0,0 +1,10 @@
+package extensions::example::lib::WSExample;
+use strict;
+use warnings;
+
+use base qw(Bugzilla::WebService);
+
+# This can be called as Example.hello() from XML-RPC.
+sub hello { return 'Hello!'; }
+
+1;