Re: Class and interface location
| From: | larry@garfieldtech.com | Date: | Wed, 19 Jan 2011 17:40:50 +0000 |
| Subject: | Re: Class and interface location | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310880@lists.php.net to get a copy of this message | ||
On 1/19/11 10:52 AM, Richard Quadling wrote:
Yes, the project is very heavily documented, and I can be rather OCD about my Docblocks. :-) The release cycle for the core system and plugins is not the same, though. Plugins are written on their own schedule and updated whenever. That means we'd need to, at minimum, do a rebuild of an individual plugin at release time and build its manifest, which is still a potentially expensive operation. Actually, thinking about it, since we cannot guarantee a file location we cannot guarantee a working autoload for reflection until after the index is built that autoload can use. That would rule out any sort of reflection approach that doesn't involve loading every PHP file we can find. Doing that individually for every plugin when it's released could get extremely expensive. Also, a PECL module is not an option unless it's possible to make a runtime version of it that can be swapped in, since we cannot guarantee the server environment we're running on beyond stock PHP. :-( (Such is life in the open source platform world.) --Larry GarfieldYou would only need to do analysis by reflection once per release though? Just like you would do to build your documentation (using something like phpdoc for example). You _do_ document your code don't you???Yeah, inclued looks cool but it looks like a runtime analysis tool, not a static analysis tool. That runs into the same problem as reflection where I'd have to include the whole code base in order to build up the indexes I need. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpRichard, While inclued performs a nice analysis of the files included at a given stage of a script, I don't see that it performs a static analysis of the PHP contained within the files so Larry could use it to detect the interfaces implemented in a given set of PHP files. I looked at the pages: http://docs.php.net/manual/en/inclued.examples-implementation.php http://docs.php.net/manual/en/function.inclued-get-data.php I'm curious about this feature myself, so if I missed something, please let me know. Thanks, AdamThere is a pecl extension called inclued [1]& [2] which could be used Ithink. It can be used to produce a list of all the relationships between included files, so a one off pass of all the class files (simply include them) and then retrieve the analysis from inclued. You can now build a class dependency tree from that data and cache it. Pretty much exactly what you need.