equal
deleted
inserted
replaced
|
1 <?php |
|
2 /** |
|
3 * IXR_ClientMulticall |
|
4 * |
|
5 * @package IXR |
|
6 * @since 1.5.0 |
|
7 */ |
|
8 class IXR_ClientMulticall extends IXR_Client |
|
9 { |
|
10 var $calls = array(); |
|
11 |
|
12 /** |
|
13 * PHP5 constructor. |
|
14 */ |
|
15 function __construct( $server, $path = false, $port = 80 ) |
|
16 { |
|
17 parent::IXR_Client($server, $path, $port); |
|
18 $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; |
|
19 } |
|
20 |
|
21 /** |
|
22 * PHP4 constructor. |
|
23 */ |
|
24 public function IXR_ClientMulticall( $server, $path = false, $port = 80 ) { |
|
25 self::__construct( $server, $path, $port ); |
|
26 } |
|
27 |
|
28 function addCall() |
|
29 { |
|
30 $args = func_get_args(); |
|
31 $methodName = array_shift($args); |
|
32 $struct = array( |
|
33 'methodName' => $methodName, |
|
34 'params' => $args |
|
35 ); |
|
36 $this->calls[] = $struct; |
|
37 } |
|
38 |
|
39 function query() |
|
40 { |
|
41 // Prepare multicall, then call the parent::query() method |
|
42 return parent::query('system.multicall', $this->calls); |
|
43 } |
|
44 } |