• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    PHP
  • Created over 14 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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.
= 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.

More Repositories

1

statsample

A suite for basic and advanced statistics on Ruby.
Ruby
401
star
2

rubyvis

Ruby version of Protovis, a visualization toolkit.
Ruby
236
star
3

rinruby

Ruby library that integrates the R interpreter in Ruby, making R's statistical routines and graphics available within Ruby.
Ruby
152
star
4

distribution

Statistical Distributions multi library wrapper. Uses Ruby by default and C (statistics2/GSL) or Java extensions where available.
Ruby
141
star
5

Rserve-Ruby-client

Pure Ruby client for Rserve. Based on 'new' Java client provided with server, but with modifications to adhere to POLS
Ruby
126
star
6

extendmatrix

Cosmin Bonchis's enhancements to the Ruby "Vector" and "Matrix" module and includes: LU and QR (Householder, Givens, Gram Schmidt, Hessenberg) decompositions, bidiagonalization, eigenvalue and eigenvector calculations. Work on Ruby 1.8.7, 1.9.1 and 1.9.2 (SVN version)
Ruby
33
star
7

buhos

Web based systematic literature review software
Ruby
27
star
8

dominanceAnalysis

Dominance Analysis (Azen and Bodescu), for multiple regression models: OLS (univariate, multivariate), beta regression, Dynamic Linear Models, GLM and HLM
R
21
star
9

minimization

Minimization algorithms on pure Ruby
Ruby
19
star
10

integration

Integration methods, based on original work by Beng
Ruby
15
star
11

svg-graph

SVG:::Graph is a pure Ruby library for generating charts, which are a type of graph where the values of one axis are not scalar. SVG::Graph has a verry similar API to the Perl library SVG::TT::Graph, and the resulting charts also look the same. This isn't surprising, because SVG::Graph started as a loose port of SVG::TT::Graph, although the internal code no longer resembles the Perl original at all.
Ruby
13
star
12

reportbuilder

Ruby report abstract interface. Creates text, html and rtf output, based on a common framework.
JavaScript
11
star
13

analisis_covid19_chile

Ejemplo de analisis de serie de tiempo sobre casos Covid-19. Se presenta un reporte comparativo de Chile con otros países, así como por regiones.
HTML
6
star
14

web-plotter3d

A web based 3d plotter, using canvas and JS
JavaScript
6
star
15

statsample-optimization

Extension for statsample, that speed some methods.
C
5
star
16

gsl_narray_stdlib_comparison

Compare perfomance of GSL, Narray and stdlib Matrix on matrix and vectors operations
Ruby
4
star
17

statsample-sem

Structural Equation Modeling on Ruby, using statsample and R
Ruby
4
star
18

exner

Create structural summary for Rorschach Comprehensive System. Works with Znudic method for Zulliger test, based on Exner's RCS.
Ruby
3
star
19

analisis_constitucion

Análisis de contenido de las diferencias entre la versión de 1980 y la versión de 2005 de la Constitución Chilena
Ruby
3
star
20

coolcat-r

Clustering algorithm Coolcat(Barbará, Couto, Li) implemented on R
R
3
star
21

buhos-windows-tk

Windows toolkit to build Buhos installer
HTML
2
star
22

dirty-memoize

Like Memoize, but designed for mutable and parametizable objects
Ruby
2
star
23

rcebn

Just some random methods I use on R. Mainly mplus interfaces and some utilities
R
1
star
24

statsample-bivariate-extension

Polychoric and Tetrachoric support for statsample
Ruby
1
star