Re: Introducing PHP source code beautifier
| From: | Alan Knowles | Date: | Sat, 21 Sep 2002 14:12:42 +0000 |
| Subject: | Re: Introducing PHP source code beautifier | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9280@lists.php.net to get a copy of this message | ||
Have you looked at the tokenizer extension - I guessed about 6 hours to write a beautifier using it..
the documentation is not up to much at present, but there are a few examples that use it:
http://cvs.php.net/co.php/pear/PECL/bcompiler/examples/bcompiler_compile.php
uses it to parse classes etc.
This is the php syntax highlighter done in PHP using the tokenizer
http://docs.akbkhome.com/akpear/PHP_CodeDoc_Data.html#output_code
Regards
Alan
Jens Bierkandt wrote:
Hi, as described on the PEAR website, I'd like to introduce my program to you hoping it might help somebody out there and, if you want to, add it to PEAR. I wrote a class using PEAR called Beautify PHP. The goal is to automatically beautify php source code files (like the common program indent, but php/pear specific) and apply common coding standards. Who could need it: * people, who get PHP code from other coders and are slightly confused * people, who can't read their own PHP code anymore * people, who want to share their PHP code * people, who want to code for PEAR with other coding standards Basic features: * automatic indentation of PHP source code according to given number of spaces * automatic newlines, if required * includes settings for braces according to C or PEAR style * quite some more Future ideas: * Use this class as a suite for future PEAR classes to test if they meet the coding standard? If you are interested in testing this class, you can check it at: http://www.bierkandt.org/beautify/ This program exists for about four month now and I got quite a lot of positive response and already got to know a guy who wants to help me and who coded additions (e.g. the implementation of the PEAR class). I'm looking forward hearing from you, Jens