I use NetConnection class to establish my connections with amfPHP. This class has a call() method which receives ...rest as last parameter which will be the values sent to PHP.
What I want is to write a Proxy class that will receives the calls that will be made to PHP and this Proxy class will make the calls instead of my DAO’s. Now, my problem is that in order to have a Proxy for NetConnection.call(), I need to receive a ...rest parameter and pass it to NetConnection as it is. But what happens is that my function casts ...rest to array and in the end PHP receives only 1 Array parameter instead of tons of parameters as it should be. Assuming that I can’t have a Proxy on PHP to handle this, how can I make sure that my ...rest parameter will be kept as ...rest for another function? Thanks.
I use NetConnection class to establish my connections with amfPHP. This class has a
Share
So
...restends up taking all the parameters remaining, and creating an array from them named rest. If you want to call a function with an array of arguments, rather then one by one, then the apply method on Function is what your looking for. I’m not familiar with NetConnection but here’s an exampleA single array of all the arguments is formed, such that apply can be used with the call method.