Re: Re: intercepting function calls

From: Date: Wed, 09 Feb 2005 18:05:44 +0000
Subject: Re: Re: intercepting function calls
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-14767@lists.php.net to get a copy of this message
>> typedef void (*fcall_begin_handler_func_t)(zend_op_array *op_array); >> typedef void (*fcall_end_handler_func_t)(zend_op_array *op_array); >> >> struct _zend_extension { >> ... >> fcall_begin_handler_func_t fcall_begin_handler; >> fcall_end_handler_func_t fcall_end_handler; >> ... >> }; > > What about patching __call() so that it is always called? > I hesitate to solve a problem via engine patch if it's at all possible to do within an extension. I havn't entirely mapped it out, but it certainly looks like some magic methods could be hooked out using a zend_extension: function __pre($funcname, &$args) {} and function __post($funcname, &$args, &$retval) for procedural calls and matching object methods for class calls. No time to look deeper myself, but curious to see what others come up with. -Sara

« previous php.internals (#14767) next »