You may not care about this, but from a readability perspective, i
think relying on $client->system being as special as you describe, is
not very readable.

If i'd had to read code that does what you describe, i'd be much
happier to see a datastructure be passed as was suggested elsewhere in
this thread, but even more happy to see something like this:

$client->system->specificMultiCall (
   0 => array('function1', 'f1p1', f1p2'),
   1 => array('function2', 'eval:f2p1', 'f2p2', 'f2p3'),
   'f2p1' => array('function3', 'f3p1', 'f3p2')

This structure allows for calling of any chain of methods, the array
returned by multiCallCommandCreate() can be ordered, the root of this
tree is the sequentially ordered integer keys, parameters are parsed
left-to-right as usual.

multiCallCommandCreate() can then set up an array for use by
specificMultiCall(), the one returned by the collection routine for
The advantages of this are possibly some extra readability, but also
some more room for expansion.

On Wed, Mar 10, 2010 at 3:13 PM, Auke van Slooten <> wrote:
> Bruno Fajardo wrote:
>> 2010/3/10 Auke van Slooten <>
>>> Hi,
>>> In a hobby project I'm relying on the order in which the following piece
>>> of PHP code is executed:
>>> $client->system->multiCall(
>>>  $client->methodOne(),
>>>  $client->methodTwo()
>>> );
>> Can't you call the methods $client->methodOne() and
>> $client->methodTwo() before the call to $client->system->multiCall()?
>> That way, you could store they values in local variables, and then
>> pass them to the $client->system->multiCall(), assuring that those
>> methods are executed before the multiCall(). Something like:
>> $methodOne = $client->methodOne();
>> $methodTwo = $client->methodTwo();
>> $client->system->multiCall($methodOne, $methodTwo);
> Hi,
> This is not what I meant. I should perhaps mention that it's an xml-rpc
> client and the method calls are remote method calls. The multiCall method
> gathers multiple method calls into a single request.
> The trick I'm using now is to set a private property in the $client->__get()
> method when the property you're accessing is 'system'. From then untill you
> call the method 'multiCall', instead of calling the methods (in this case
> methodOne and methodTwo) the client creates a new object with the call
> information (method name and arguments) and returns that. In multiCall all
> arguments are therefor call information objects and multicall creates a
> single request based on that information.
> So in your example the client would simply call methodOne and methodTwo and
> return the results. Then it would try to do a multiCall with whatever the
> previous methods have returned.
> regards,
> Auke van Slooten
> Muze
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to