I wanted a tool that formatted php from the command line. phpstylist does what I want, but it is tedious to supply the options each time you run it. Below is a wrapper so you can set default options.
- Save phpstylist as /usr/local/bin/phpStylist.php
- Save the script below as /usr/local/bin/pstyle
- set MAKE_BACKUP='yes' , if you want to keep the original unformulated files
- set MAKE_HTML to a lower case 'yes or 'no' make an html copy of the formatted file
- un-comment the # STYLIST_OPTIONS+= lines that contain the php formatting options you want
- Be sure /usr/local/bin/ is in your $PATH
pstyle phpFile1.php phpFile2.php phpFile3.php