You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

45 lines
963 B

  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. * PHP5 constructor.
  13. */
  14. function __construct( $server, $path = false, $port = 80 )
  15. {
  16. parent::IXR_Client($server, $path, $port);
  17. $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
  18. }
  19. /**
  20. * PHP4 constructor.
  21. */
  22. public function IXR_ClientMulticall( $server, $path = false, $port = 80 ) {
  23. self::__construct( $server, $path, $port );
  24. }
  25. function addCall()
  26. {
  27. $args = func_get_args();
  28. $methodName = array_shift($args);
  29. $struct = array(
  30. 'methodName' => $methodName,
  31. 'params' => $args
  32. );
  33. $this->calls[] = $struct;
  34. }
  35. function query()
  36. {
  37. // Prepare multicall, then call the parent::query() method
  38. return parent::query('system.multicall', $this->calls);
  39. }
  40. }