Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:491 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56431 invoked from network); 30 Mar 2003 02:05:40 -0000 Received: from unknown (HELO alanathome.ossc.com.hk) (202.81.246.113) by pb1.pair.com with SMTP; 30 Mar 2003 02:05:40 -0000 Received: from alanportable2.akbkhome.com ([192.168.0.184] helo=akbkhome.com) by alanathome.ossc.com.hk with esmtp (Exim 3.36 #1 (Debian)) id 18zSCR-0007Ap-00; Sun, 30 Mar 2003 10:05:31 +0800 Message-ID: <3E86505C.1080509@akbkhome.com> Date: Sun, 30 Mar 2003 10:03:08 +0800 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrei Zmievski CC: PHP Internals References: <20030329203729.GG23063@hyperion.gravitonic.com> In-Reply-To: <20030329203729.GG23063@hyperion.gravitonic.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Reflection API RFC From: alan@akbkhome.com (Alan Knowles) A few more ideas for it:) - If you stored token start/end then you would be able to do getSource for function/method/class.. etc.. (which can do a load file/tokenizer and return implode('',array_range(starttoken,endtoken) - and add the generic methods loadTokens(); and freeTokens(); so that memory can be managed reasonably for them.. * it may also be better to store the token of the doc comment - On some of the pear classes the comment code is larger than the PHP code, and would be quite an overhead... - just make it throw an exception if you forgot to load the tokens for it.. - there appears to be no arguments array for methods/functions - not sure if extendsClass(), would be implemented by Implements?, and theres no getExtendsArray(), to return the tree of extends - constructors: - $classdetails = new ClassType('myclass'); $classdetails = new ClassType($this); rather than $classdetails = ClassType::fromName('myclass') $classdetails = ClassType::fromInstance('myclass') - I still think it would be nice to implement some of them as variables so that print_r($classdetails); would display some cute output... btw - It would also be nice to have unloadclass - so a) the codedoc generators - could load and free classes. b) php-gtk could reload modules rather than having to restart each time to test code.. Regards Alan Andrei Zmievski wrote: >I have the first draft of PHP 5 reflection API ready. You can find it >at: > > http://www.gravitonic.com/software/php/reflection.txt > >Comments and suggestions are appreciated. > >-Andrei http://www.gravitonic.com/ > >"Beware of bugs in the above code; I have only proved it correct, > not tried it." -- Donald Knuth > > >