Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11425 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14208 invoked by uid 1010); 21 Jul 2004 14:02:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14152 invoked from network); 21 Jul 2004 14:02:40 -0000 Received: from unknown (HELO mail.bpservers.com.ar) (200.32.3.79) by pb1.pair.com with SMTP; 21 Jul 2004 14:02:40 -0000 Received: (qmail 8819 invoked by uid 0); 21 Jul 2004 14:02:38 -0000 Received: from unknown (HELO ?192.168.0.240?) (168.226.82.221) by 200-32-3-79.prima.net.ar with SMTP; 21 Jul 2004 14:02:38 -0000 Reply-To: lpedretti@suserver.com Organization: Axon Sistemas To: PHP Internals List Date: Wed, 21 Jul 2004 11:03:09 -0300 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-ID: <200407211103.09895.lpedretti@suserver.com> Subject: catch of object operations __set and __invoke From: lpedretti@suserver.com (Leonardo Pedretti) Hi all. I have just messed around with the php 5 code so to find a way to implement= =20 some way to make objects call some magic method when there is an invocation= =20 of a non existent method, or a setting of a non existent data member (this= =20 last may not be neccesary by now for what i am implementint, but it would b= e=20 correct to implement them both). I have tracked in the zend_execute.c file, line 2507, the call to the error= =20 when the method is not found, inside the function=20 zend_init_method_call_handler My question is: the parameter lists in every call is a defined constant... = it=20 just becomes impossible to backtrack, can someone give me just a bit of=20 information on this topic? What i think would be correct is that the function that calls=20 zend_init_method_call_handler receives an error in the case the method is n= ot=20 found, and in that case it calls the handler again calling __invoke() with = an=20 array of the original parameters and the name of the original function that= =20 was called. Another method would be to always call __invoke() passing it th= e=20 original call information, and depending on the return code of __invoke()=20 then execute the original call. However, I can't find where this hook should be placed around the code. If= =20 someone can give me a bit of info on this topic, i would love to make the=20 patch. With regards =2D-=20 Leonardo Pedretti Axon Sistemas L=EDder de Equipo Proyecto Basalto