[wp-hackers] How to exntend wp_xmlrpc_server in plugin

Kurt Payne kpayne+wordpress+hackers at gmail.com
Fri Aug 3 15:43:13 UTC 2012


Ryan,

Do you have documentation on this?

I was looking for docs on opcode caches being able to cache classes
declared in if-blocks and couldn't find any...

Thanks,

--Kurt


On Fri, Aug 3, 2012 at 5:32 AM, Ryan McCue <lists at rotorised.com> wrote:

> Otto wrote:
> > function my_class($name) {
> >
> > class my_xmlrpc_class extends wp_xmlrpc_server {
> > ... class stuff here ...
> > }
> >
> > return 'my_xmlrpc_class';
> > }
>
> Correct me if I'm wrong, but wouldn't this have a huge performance
> penalty, since you're declaring a class inside a function? (Which IIRC
> can't be cached properly by an opcode cache)
>
> (In this case, I'm assuming it's necessary since wp_xmlrpc_server won't
> be declared when the plugin is loaded, but I'd like to make sure.)
> --
> Ryan McCue
> <http://ryanmccue.info/>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list