Hi all,

I'm starting to work with Zend_Amf_Server, and I'm having some trouble attaching an object *instance*. My code is like:

$server = new Zend_Amf_Server();
$server->setClass($object);
echo $server->handle();

It seems that in this scenario, Zend_Amf_Server is creating its own separate instance from the $object passed to setClass(), which is unworkable for me because $object has properties that I need to use to perform the work needed for the AMF response.

I had initially tried to use addFunction() instead of setClass(), because the method's docblock advertises that it supports valid callbacks. Unfortunately, when I do:

$server->addFunction(array($object, 'somePublicAmfResponderFunction'));

I get a terse exception thrown:

"Unable to attach function"

I think that this is a bug, but I wanted to report here to get feedback first. Shall I create an issue in JIRA?

Does anyone know how to get Zend_Amf_Server to use an *instance* that is passed to it, so that it can take advantage of the object's state? Or maybe there is an alternative approach that I should use?

Thanks in advance for whatever help you may offer! :)

Best regards,
Darby

Reply via email to