Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14767 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77040 invoked by uid 1010); 9 Feb 2005 18:34:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76794 invoked by uid 1007); 9 Feb 2005 18:34:55 -0000 Message-ID: <20050209183452.76734.qmail@lists.php.net> To: internals@lists.php.net References: <20050209055745.928.qmail@web50206.mail.yahoo.com> <20050209155704.61669.qmail@lists.php.net> Date: Wed, 9 Feb 2005 10:05:44 -0800 Lines: 22 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Posted-By: 169.229.135.141 Subject: Re: [PHP-DEV] Re: intercepting function calls From: pollita@php.net ("Sara Golemon") >> 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