Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:554 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21589 invoked from network); 31 Mar 2003 20:53:01 -0000 Received: from unknown (HELO localhost.localdomain) (65.198.110.5) by pb1.pair.com with SMTP; 31 Mar 2003 20:53:01 -0000 Received: (from andrei@localhost) by localhost.localdomain (8.11.6/8.11.6) id h2VKqL518482; Mon, 31 Mar 2003 15:52:21 -0500 X-Authentication-Warning: localhost.localdomain: andrei set sender to andrei@gravitonic.com using -f Date: Mon, 31 Mar 2003 15:52:21 -0500 To: Alan Knowles Cc: PHP Internals Message-ID: <20030331205220.GA18455@hyperion.gravitonic.com> Mail-Followup-To: Andrei Zmievski , Alan Knowles , PHP Internals References: <20030329203729.GG23063@hyperion.gravitonic.com> <3E86505C.1080509@akbkhome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E86505C.1080509@akbkhome.com> User-Agent: Mutt/1.4i Subject: Re: [PHP-DEV] Reflection API RFC From: andrei@gravitonic.com (Andrei Zmievski) On Sun, 30 Mar 2003, Alan Knowles wrote: > - 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) Keeping track of the tokens this way would require quite some code, I think. > * 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.. Hmm, I see the point, but is that really a problem? If a lot of people are worried about the overhead of storing doc comments, we could perhaps store only the starting/ending line of the comment and let the other tools extract them. But it means that the tools have to have access to the original source file - not really possible with 3rd party software distributed under an encoder, for example. > - there appears to be no arguments array for methods/functions No really good way of doing it with the current architecture. I defer to Andi/Zeev to see if it's possible to capture the declared parameters somehow.. > - not sure if extendsClass(), would be implemented by Implements?, and > theres no getExtendsArray(), to return the tree of extends What would extendsClass() do? > - constructors: - > $classdetails = new ClassType('myclass'); > $classdetails = new ClassType($this); > rather than > $classdetails = ClassType::fromName('myclass') > $classdetails = ClassType::fromInstance('myclass') I'd rather avoid overloading. And in this case, these methods are basically factories. > - I still think it would be nice to implement some of them as variables > so that > print_r($classdetails); would display some cute output... We could always have toString() method for each one.. > 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.. What do you mean by unloadclass? -Andrei http://www.gravitonic.com/ "This isn't right. This isn't even wrong." -- Wolfgang Pauli