Using PDT : Installation : Installing the PHP Beautifier
From PDTWiki
Contents |
[edit] About PHP_Beautifier
The PHP_Beautifier reformat and beautify PHP 4 and PHP 5 source code files automatically.
- It is Open Source and distributed under the terms of PHP Licence, written in PHP 5, and has a command line tool.
- More information can be found at the PHP_Beautifier documentation page.
[edit] Installing the phpBeautifier source
- Download phpDocumentor here : PHP Beautifier (I took the lastest stable: PHP_Beautifier 0.1.11 (beta) released on 2006-06-15).
- Extract the sources to a directory of your choice.
[edit] Implementing phpBeautifier into Eclipse
- Open Eclipse and choose the menu item External Tools from the Run menu (see picture)
- Choose the item Program and click on New. A blank form will appear on the righthandside of the window. Fill in the appropiate data as shown in the picture.
Glossar:
- Location: Fullpath to your php installation (I use xampp ;o) ).
- Working Directory: Fullpath where to store temporary files and data
- Arguments: string you will pass to shell to execute phpBeautifier on the CLI (exapmle: see picture).
NOTE: If you're using Windows, enclose the paths (defined by the ${project_loc} with "" (double quotes) if the paths include spaces...
You need to replace PATH\TO\ by the fullpath to your phpBeautifier- source defined above. As you see in the above picture I used the ${resource_loc} variable first to find the file to be beautified and to name the output file (${resource_loc}.bphp). A new file will be created due to backup reasons.
- The next pictures show the rest of the configuration of eclipse for phpBeautifier. As you see I took the same pictures as in Installing the phpDocumentor. Just replace 'PHPDocumentor' by 'phpBeautifier file' and this is how the following pictures shall look like. I skipped the Environment slider because there is nothing to be set or changed.
- The Refresh- slider:
- The Common- slider:
- To finally store the new program click on Apply at the bottom of the window.
[edit] Sources
This text was cut'n pasted from Plog4U





