Using PDT : Installation : Installing the PHP Beautifier

From PDTWiki

Jump to: navigation, search


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.

Installing the phpBeautifier source

Implementing phpBeautifier into Eclipse

  • Open Eclipse and choose the menu item External Tools from the Run menu (see picture)
Menu to be chosen
  • 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.
New external program creation: Main slider


  • 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.
    1. The Refresh- slider:
      New external program creation: Refresh slider
    2. The Common- slider:
      New external program creation: Common slider
  • To finally store the new program click on Apply at the bottom of the window.


This text was cut'n pasted from Plog4U

Personal tools