https://github.com/cubiclesoft/php-short-open-tag-finder
Intelligent command-line tool to find software references to short open tags with an optional "ask to replace" mode. Compatible with all versions of PHP, including PHP 8.
https://github.com/cubiclesoft/php-short-open-tag-finder
Last synced: about 1 year ago
JSON representation
Intelligent command-line tool to find software references to short open tags with an optional "ask to replace" mode. Compatible with all versions of PHP, including PHP 8.
- Host: GitHub
- URL: https://github.com/cubiclesoft/php-short-open-tag-finder
- Owner: cubiclesoft
- Created: 2019-04-13T14:01:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T17:06:49.000Z (almost 6 years ago)
- Last Synced: 2025-03-24T11:44:28.769Z (about 1 year ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Support: support/cli.php
Awesome Lists containing this project
README
Short Open Tag Finder for PHP
=============================
An intelligent command-line tool to find software references to short open tags with an optional "ask to replace" mode. Compatible with PHP 5.4 and later, including PHP 8.
PHP 7.4 deprecates short open tags and PHP 8 and later removes short open tag support altogether.
If you are scrambling around looking for a tool that aids in finding and replacing short open tags that also works with PHP 8 (e.g. you deployed PHP 8 without reading the changelog and therefore can't easily rollback to PHP 7) but doesn't just bulk update your files like a grep/sed solution would, then you've come to the right spot.
This tool has been successfully validated against 9.45 million lines of PHP code spanning 31,000+ files across multiple systems with a variety of mixed short open and regular tags in various configurations. This tool utilizes the PHP `token_get_all()` function to correctly parse and make modifications against each document instead of incorrectly using regular expressions. The tool is relatively short (~275 lines) and reasonably well-commented.
Features
--------
* Finds files that use the PHP short open tag `` and outputs the line number, the file, and the line itself.
* When the `-ask` option is used, shows proposal replacement lines with normalized `