Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Artifact ID: | 7239d00391f8caf86bcbb8d6f47fd81df535ada8 |
---|---|
Page Name: | phptags tag tidier |
Date: | 2014-11-07 18:53:26 |
Original User: | mario |
Parent: | 8f220332becc0bf5edebe3541ef5ecac5fcc0844 (diff) |
Next | 0c810430352513954fd6b441cc359a75a2fc4365 |
Content
phptags
phptags is a simple command-line tool to automate the rewriting of PHP open and close tags.
- It can convert between short `<?` and long `<?php` open token.
- Add missing
?>
close tags. - Excise
`?>`close tags. - Correct leading or trailing `␣` whitespace / UTF-8 BOM issues.
It utilizes either regex and/or the tokenizer.
project pages
- http://freshcode.club/projects/phptags (updates)
- http://include-once.org/p/phptags/ (download)
- http://fossil.include-once.org/phptags (repository)
- http://apt.include-once.org/ (packages)
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.