PHPackages                             genasyst/php-compressor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. genasyst/php-compressor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

genasyst/php-compressor
=======================

PHP code compressor or obfuscator

1.0(7y ago)15452[3 issues](https://github.com/genasyst/phpCompressor/issues)MITPHPPHP &gt;=5.4

Since Nov 11Pushed 7y ago2 watchersCompare

[ Source](https://github.com/genasyst/phpCompressor)[ Packagist](https://packagist.org/packages/genasyst/php-compressor)[ Docs](https://github.com/genasyst/phpCompressor)[ RSS](/packages/genasyst-php-compressor/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

phpCompressor
=============

[](#phpcompressor)

View work and use compressor [DEMO](http://phpcompressor.genasyst.ru/index.php)

README.RU.md [РУССКОЕ ОПИСАНИЕ](https://github.com/genasyst/phpCompressor/blob/master/README.RU.md)

[![Packagist](https://camo.githubusercontent.com/db9b4aad43bb21eeed3de6ca64c58765b0b18b7945f268ee39177787f221d2c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67656e61737973742f7068702d636f6d70726573736f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/genasyst/php-compressor)[![Github issues](https://camo.githubusercontent.com/11782b2582bedac075ec9a2a18317173f29390298c28bbb5a7fc4d9f4a88f106/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f67656e61737973742f7068702d636f6d70726573736f722e7376673f7374796c653d666c61742d737175617265)](https://github.com/genasyst/php-compressor/issues)

phpCompressor - The main task of compressing PHP code, it is also possible to use as a simple PHP obfuscator. The compressor compresses the code by removing spaces, line breaks code comment, abbreviations of names of local variables in functions, abbreviations of names of property classes (variables), abbreviations of names of class methods.

Reduction settings
==================

[](#reduction-settings)

- Reduction of local variable names in functions
- Reduction of names of properties of classes (variables)
- Reduction of the names of class methods
- To remove spaces, comments and line breaks

The principle of abbreviating names
===================================

[](#the-principle-of-abbreviating-names)

Aliases are used to abbreviate names, which are formed depending on the frequency of use of the name.

For example: the name 'data' is used 98 times in the code, 'options' - 70 times, 'values' - 68 times, etc.on fading... The result will be

- 'data' =&gt; 'a'
- 'options' =&gt; 'b'
- 'values' =&gt; 'c'
- '...' =&gt; 'd...aa'
- 'rare\_name' =&gt; 'ab'
- .....

Installation
============

[](#installation)

To install, use the composer [composer](https://getcomposer.org):

```
php composer.phar require genasyst/php-compressor

```

Example of use
==============

[](#example-of-use)

```
