PBphpminifier – PHP Code Minimizer (Windows)

By Acty, October 21, 2013

The PBphpminifier is a small and fully portable tool which is running under Windows XP/Vista/7 (Windows 8/8.1 still has to be tested some more time…) and can be used to minify PHP code. During the minifying process, the filesize will be reduced because all comments, linebreaks and a lot of spaces will be removed. There are 7 optimizing levels to adjust for the compatibility of the PHP scripts. There is also an option which replaces the existing variables and makes the code unreadable and difficult to understand.This is not a kind of encryption but the structure and the informative names of the variables will be lost. It is possible to specify a list of files and/or variables which will not be minified. This can be helpful if you don’t want your configuration files to be scrambled. The variables will be replaced because without that, the configuration script can not interact anymore with other minified files. It is also possible to exclude variables from beeing replaced. Some variables like $_SERVER, $_GET, $_POST will be disabled by default. This configuration can be project specific. Each project can have his own exclude configuration file which specifies the excluded components for the specific project. After the minifying process each script runs through the PHP parser and is checked for syntax errors. The PBphpminifier tool has a well written User Manual of 40 pages (1.1 MB – PDF format). This script is for everyone who wants to obfuscate his PHP code, reduce the filesize for installation packages (faster upload/download) or make the PHP code less readable/understandable for outsiders. Reducing the size of the PHP code does not increase the speed of the website or web application because the code will be processed from the webhost and not from the client browser!