while trying to implement a generic wrapper layer for my webserver model
classes i realized that methods implemented within the __call method can't
be called from the server.
Reflection is used within the setClass, when you try to add classes to your
server. So i patched the Zend_Server_Reflection_Class to allow wrapper
classes to provide additional methods for Reflection.
It's working prety well, so i'd like to share this patch:
http://zend-framework-community.634137.n4.nabble.com/file/n3215966/2011-01-13_Server_Reflection_Class.diff
2011-01-13_Server_Reflection_Class.diff
In order to share additional methods, your wrapper class have to implement a
static function __getMethods, that could look like this:
final static public function __getMethods(ReflectionClass $reflection,
$namespace = null, $argv = false)
{
return Zend_Server_Reflection::reflectClass(self::$_wrappedClass, $argv,
$namespace)->getMethods();
}
It's pretty useful, if you like to do ACL and caching in different layers
wrapped around the real functionality of your server.
Actually i don't like patching libraries. But most zend servers use a static
reflection class, you cannot replace with any option.
I would really appreciate, if a feature like this would be integrated deeper
within php, so declaring hidden methods would be also possible for php's
ReflectionClass and get_class_methods.
I'd would be nice, if you could post me some feedback on this topic
Sincerely,
Gordon
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Reflection-for-methods-implemented-with-the-call-method-tp3215966p3215966.html
Sent from the Zend Server mailing list archive at Nabble.com.
没有评论:
发表评论