𝌔 Fossil Hub
Login | Fossil manual |
phptags tag tidier

Update of "phptags tag tidier"

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

Overview

Artifact ID: b4faadc55f867ff2878d24405ca711bf4584cdac
Page Name:phptags tag tidier
Date: 2014-11-07 19:05:41
Original User: mario
Mimetype:text/x-markdown
Parent: c14e1d152100ca1c87afb78e533cc22e98dfbc2a
Content

phptags

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

  • It can convert between short <? and long <?php open tokens.
  • Add missing ?> close tokens.
  • Excise ?> close tags.
  • Correct leading or trailing 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 ^ for the complete reference.