Index: Server.php =================================================================== --- Server.php (revision 21524) +++ Server.php (working copy) @@ -347,7 +347,11 @@ } else { // Object methods try { - $object = $info->getDeclaringClass()->newInstance(); + if (is_object($this->_classAllowed[$class])) { + $object = $this->_classAllowed[$class]; + } else { + $object = $info->getDeclaringClass()->newInstance(); + } } catch (Exception $e) { require_once 'Zend/Amf/Server/Exception.php'; throw new Zend_Amf_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $info->getName() . ': '.$e->getMessage(), 621, $e); @@ -743,9 +747,13 @@ if ($namespace == '') { $namespace = is_object($class) ? get_class($class) : $class; } + + if (is_object($class)) { + $this->_classAllowed[get_class($class)] = $class; + } else { + $this->_classAllowed[$class] = true; + } - $this->_classAllowed[is_object($class) ? get_class($class) : $class] = true; - $this->_methods[] = Zend_Server_Reflection::reflectClass($class, $argv, $namespace); $this->_buildDispatchTable();