𝌔 Fossil Hub
Login | Fossil manual |
phptags tag tidier

Update of "phptags tag tidier"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


Artifact ID: 0f8bdae311b4bb10e34c40905da8f6afe204677b
Page Name:phptags tag tidier
Date: 2014-11-07 18:55:41
Original User: mario
Parent: eebd4b08876887aa8597dbfdfab972f015248cd6 (diff)
Next 68cde550163999d5a90aedf8da9a197c48e73b4b


phptags is a simple command-line tool to automate the rewriting of PHP open and close tags.

  • It can convert between short <mark><?</mark> and long <mark><?php</mark> open tokens.
  • Add missing <mark>?></mark> close tokens.
  • Excise <mark>?></mark> close tags.
  • Correct leading or trailing <mark></mark> whitespace / UTF-8 BOM issues around them.

It utilizes either regex and/or the tokenizer.

project pages

usage examples

  • phptags --whitespace *.php cleans up spaces or UTF-8 BOM issues before opening and after close tags
  • phptags --warn directory/ searches through a directory and just warns about whitespace issues
  • phptags --close --long --tokenizer *.php adds close tags, converts open tags into long form <?php and uses the more reliable --tokenizer mode (instead of --regex)
  • phptags --unclosed --shortall dir/ ../*.tpl includes/ converts all tags into short forms, and strips close tags of a document (it's advised to rather have whitespace issues fixed than keep using the newcomer workaround)
See also --help or the [manpage] [http://fossil.include-once.org/phptags/finfo?name=manpage.1 ^] for the complete reference.