summaryrefslogtreecommitdiffstats
path: root/user_guide
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-05-08 20:57:58 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-05-08 20:57:58 +0200
commit044379d18fbfb7673e5a5992e9c5af7830e358a8 (patch)
tree5da131e8e2e635fc49b59e05570acfa7ba520e5d /user_guide
parent0f13a13bbf7bc54dc2ef4dda44bbe2f3890af8c6 (diff)
added 'object' key to the XML-RPCS config allowing the passing of a class object for method calls that aren't part of the CI super object
Diffstat (limited to 'user_guide')
-rw-r--r--user_guide/libraries/xmlrpc.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html
index e77158c47..b7e98f653 100644
--- a/user_guide/libraries/xmlrpc.html
+++ b/user_guide/libraries/xmlrpc.html
@@ -180,8 +180,9 @@ class and method for processing.</p>
$this->load->library('xmlrpc');<br />
$this->load->library('xmlrpcs');<br />
<br />
-$config['functions']['<var>new_post</var>']&nbsp;&nbsp;= array('function' => '<dfn>My_blog.new_entry</dfn>');<br />
-$config['functions']['<var>update_post</var>'] = array('function' => '<dfn>My_blog.update_entry</dfn>');<br />
+$config['functions]['<var>new_post</var>'] = array('function' => '<dfn>My_blog.new_entry</dfn>'),<br />
+$config['functions]['<var>update_post</var>'] = array('function' => '<dfn>My_blog.update_entry</dfn>');<br />
+$config['object'] = $this;<br />
<br />
$this->xmlrpcs->initialize($config);<br />
$this->xmlrpcs->serve();</code>
@@ -189,6 +190,9 @@ $this->xmlrpcs->serve();</code>
<p>The above example contains an array specifying two method requests that the Server allows.
The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.</p>
+<p>The '<var>object</var>' key is a special key that you pass an instantiated class object with, which is necessary when the method you are mapping to is not
+ part of the CodeIgniter super object.</p>
+
<p>In other words, if an XML-RPC Client sends a request for the <var>new_post</var> method, your
server will load the <dfn>My_blog</dfn> class and call the <dfn>new_entry</dfn> function.
If the request is for the <var>update_post</var> method, your
@@ -196,8 +200,7 @@ server will load the <dfn>My_blog</dfn> class and call the <dfn>update_entry</df
<p>The function names in the above example are arbitrary. You'll decide what they should be called on your server,
or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.</p>
-
-
+
<h2>Processing Server Requests</h2>
<p>When the XML-RPC Server receives a request and loads the class/method for processing, it will pass