public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Search Repo:
Added CmsXmlRpc::send_message

Signed-off-by: Ted Kulp <ted@cmsmadesimple.org>


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4453 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Sat Apr 26 10:01:15 -0700 2008
commit  a401304580af19d7e1a74c90f256beb257209a93
tree    fda62bc3a6e5c41101e12b6d455dfcfc96290018
parent  68e9e77b6bdc9b3db937026d3f89f71b71d5fac8
...
21
22
23
 
 
 
 
 
24
25
26
...
53
54
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
57
58
...
21
22
23
24
25
26
27
28
29
30
31
...
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
0
@@ -21,6 +21,11 @@
0
 require_once cms_join_path(ROOT_DIR,'lib','xmlrpc','xmlrpc.inc');
0
 require_once cms_join_path(ROOT_DIR,'lib','xmlrpc','xmlrpcs.inc');
0
 
0
+class CmsXmlRpcException extends Exception
0
+{
0
+
0
+}
0
+
0
 class CmsXmlrpc extends CmsObject
0
 {
0
   static private $server = null;
0
@@ -53,6 +58,23 @@
0
       $name = $namespace . "." . $name;
0
 
0
     self::$server->add_to_map($name, $callback);
0
+ }
0
+
0
+ function send_message($name, $params, $url)
0
+ {
0
+ $msg = new xmlrpcmsg($name, $params);
0
+ $client = new xmlrpc_client($url);
0
+ $client->return_type = 'phpvals';
0
+
0
+ $result = $client->send($msg);
0
+ if (!$result->faultCode())
0
+ {
0
+ return $result->value();
0
+ }
0
+ else
0
+ {
0
+ throw new CmsXmlRpcException($result->faultString(), $result->faultCode());
0
+ }
0
   }
0
 }
0
 

Comments

    No one has commented yet.