[wp-hackers] How to exntend wp_xmlrpc_server in plugin
peter baylies
pbaylies at semperfiwebdesign.com
Fri Aug 3 16:01:22 UTC 2012
Ryan,
I don't know the real nitty gritty details here re: opcode caching, but
I'll ask, how is this manifestly different from what WordPress plugins
already do? Classes get conditionally included from functions all the time,
and PHP opcode caches appear to deal with that just fine. See, for example,
the code for activate_plugin() in wp-admin/includes/plugin.php.
Cheers,
-- Peter
On Fri, Aug 3, 2012 at 8: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