Comments for "PHP_Beautifier"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Stefan Neufeind  [2004-05-16 21:48 UTC]

    Generally the class looks good to me.

    Have you evaluated how PHP-specific the code is - or if it could maybe used as a Sourcecode_Beautifier to also highlight C-code, maybe Python, Pascal or the like. I was it uses token_get_all() from PHP - but maybe another tokeniser could be added? Just wondering if this effort was maybe already done e.g. by Greg or Davey when developing their generic Highlighters.

    Another thing that I have mixed feelings about are the "filters". I like the approach in general, but I'm not sure it's flexible enough to really fulfill all coding-style-needs that might arise. I had a look at your pear-filter and wonder if it can be flexible enough to even take care of things like "one space after the comma that separates function-parameters" or "no space between functionname and opening parameter-parenthesis" etc.
    One minor point I was a bit unsure about when looking at the pear-filter: I can also understand that you might consider putting the vim-line as a header into the source. But imho pasting the ready-filled license-header into the source it not a good idea. And what if I simply forgot the vim-headerline but had LGPL in the code etc.? Then another PHP-license-header will be added. But this is just a minor point of discussion.

    Please excuse me for not having a deeper look yet. But hopefully others will comment different aspects soon as well.

    As a closing sentence, please let me stress again that I very much appreciate your proposal and would like to see some beautifier like this added to pear. I just wonder if it might be implemented more generic and flexible.
  • Jan Schneider  [2004-05-20 10:27 UTC]

    The .phps files on your server are currently sent to the browser instead of being interpreted/highlighted.
  • Lukas Smith  [2004-05-21 19:36 UTC]

    would it be possible to make this package compatible with php4 and php5?