Coder Social home page Coder Social logo

solertis / php_beautifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clbustos/php_beautifier

0.0 3.0 0.0 1.35 MB

This program reformat and beautify PHP 4 and PHP 5 source code files automatically. The program is Open Source and distributed under the terms of PHP Licence. It is written in PHP 5 and has a command line tool.

Home Page: http://pear.php.net/package/PHP_Beautifier

PHP 97.28% Ruby 0.21% Shell 0.03% Batchfile 0.28% CSS 1.69% ApacheConf 0.02% TeX 0.49%

php_beautifier's Introduction

= What is PHP_Beautifier?

PHP_Beautifier is a Open Source PHP aplication, distributed under the terms of PHP Licence 3.0. This program tries to reformat and beautify PHP 4 and PHP 5 code automatically.
Who needs it?

    * developers who get PHP code from other coders and are slightly confused
    * developers who can't read their own PHP code anymore
    * developers who want to share their PHP code

== Little history background

The first version of the program, PhpBeautify, was developed on Php 4 by Jens Bierkandt. In 2003 reached the 'stable' state and is the recomended version for the Php 4 users. This version works almost flawlessy, but was difficult to enhance, and have some problem with strange structures, like pascal-like control instructions and 'switch' structures

With the stabilization of tokenizer and incoming of PHP 5, the need of a new version of the program arise. So, the code for the new version was developed from scratch by Claudio Bustos in 2004, based on the Php Tokenizer and the use of a Plug-in architecture.
Where I can get PHP_Beautifier?

PHP_Beautifier resources are distributed on three sites:

    * PEAR: Download, Change Log and bug report
    * Github: Sourcecode (GIT), wiki and forum

== Features of PHP_Beautifier

    * Version independent: Needs PHP5 to work, but can handle PHP 4 and PHP 5 scripts. Should beautify PHP 3, too (if anyone test it, please send a report)
    * Plataform-independent: Should work on all the plataforms that supports PHP 5. Tested on Windows 98,2000,XP and Linux Gentoo 1.4.6
    * Automatic indentation of PHP source code according to given number of spaces
    * Automatic newlines, if required
    * You can use the web frontend, command line or, if you prefer, could use the class directly
    * Plug-in architecture, by the use of Filters. The control of beautify proccess is delegated on the Filters.
    * The code to beautify can make callbacks to the base class and the filters. So, you can set the options for the beautify inside the same file. See Callbacks
    * Batch processing. You can beautify multiple files inside directories (recursively, if you want to) and save they in another directory.
    * Parse only Php Code. All other tokens (HTML,Comments) are bypassed to the output
    * HEREDOC parsed without any indentation
    * Use of braces for indexing a string (ex. $this->myString{1}) doesn't produce strange indentation
    * Switch statements are indented as spected

== Works with PHP 4 scripts? Will be a PHP 4 version?

This package needs PHP 5 to run, but can handle any PHP file, including PHP 4 and PHP 5 scripts.

In the near future, no. The use of exceptions, overloading & tokenizer - both experimental on PHP 4 - and passing by reference by default for objects could be simulated, but I prefer to focus my effort on PHP 5. But this only affect the installation of the package; you can beautify script written for PHP 4 and PHP 5, without any problem.

== Is secure to use?

The source code of the package beautify itself without any problem. I work with an application with more than 40.000 lines of PHP 4 source code and I did't have any broken file since 0.0.6 version.

The package have a test suite to verify all the important functions. Any bug have a test to verify the fix.

So, IMHO, you can use this application with confidence. Anyway, you always should make regular backups of your files and use some control version system, like CVS or Subversion.

php_beautifier's People

Contributors

clbustos avatar csirmaz avatar dohzoh avatar jespino avatar kcivey avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.