Download the PHP package vregistry/packapp without Composer

On this page you can find all versions of the php package vregistry/packapp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package packapp

PHP Application Packer

PackApp.php is a complete solution to pack your application's project files into the delivery package. The source code is minified and obfuscated, impeding unauthorized use.

The target audience: ISVs, freelancers, developers, resellers, all who need a lightweight utility to turn the project into the delivery package. The solution is oriented to the PHP applications, but can be used for the front-end projects too.

There are many minifiers, obfuscators, encoders around. Some commercial encoders are very good, but rather expensive and may require system extensions. The others are limited with a single source type only. The Packer is a handy integrated solution.

How it works

PackApp.php packs the project files: minifies the source (html, css, js, json, php, xml), obfuscates the code (js, php) and compresses the result files. The source can be either a single file or a folder which may have sub-folders. The destination is a packed file or a folder with the packed files. The ZIP archives are handled also: folder-to-zip, zip-to-folder, zip-to-zip.

The Packer passes the source to according minify plugin depending on the file type. The css and js that detected inside the html are minified too. The html, css and js are looked for the embedded php to minify (except obfuscated js). You can create the user plugins for more file types.

The js and php code can be obfuscated to inhibit its unauthorized use. The reverse engineering of the packed code becomes too expensive. The identifiers replacement algorithm used by the Packer is more protective than trivial applying of the base64_encode and eval. However, you must follow certain naming rules to avoid the renaming conflicts. The php obfuscation is supported by the standard edition.

There are several options to control the processing. Use them for specific cases and rely on defaults mostly. Launch the Packer via the GUI or instantiate and call directly. Various statistics are returned about the processing results. You can display and/or save this data.

Versioning

The Packer has the free and extended versions. Free version minifies the source and can be launched via instantiation only.

Extended version includes also the GUI and requires the setup (license registration) before using. The extended version has the following editions:

You can obtain the extended version from here.

The usage

The program requires PHP 5.4+. Start it from your script via GUI (except free version) or instantiation (see The package).

The starter script must be in the same directory with the PackApp.php:

require('PackApp.php');

A) Launching the GUI:

echo PackApp::Packer();

B) Instantiation and invocation:

$obj = new PackApp( [$lvl [,$opt]] );

$obj->Pack( $old [,$new [,$rpl]] );

The parameters

$lvl - processing level, the sum of the following integers:

$opt - the options array:

PHP obfuscation options:

$old - source file/folder/archives

$new -- destination (default by $old value suffixed by sfx option value)

$rpl -- replace destination if exists (default by false)

Return data

The $obj->Pack() returns the results associative array:

You can display and/or save the statistics. See example.php about the using.

Packing

The files are minified by default and obfuscated (js, php) if required. The php templates are packed for the html, js, css, php. The source file is processed when its type matches one of the following (wildcards allowed);

The rest of the files are simply copied or skipped. Use the pgn option for additional types (see below). The folder or archived source is saved to the destination folder or archived depending on the $new parameter.

Minifying

The source files of relevant file type are minified by removing the comments, whitespaces and linebreaks. The *htm* files are checked for the style and script tags which content is minified too. The files (except xml) are checked also for the php tags to pack their content.

Obfuscating

The minified source is obfuscated depending on the $lvl parameter value. The JavaScript code is packed into the eval() statement replacing the original identifiers. The PHP obfuscation requires the standard edition.

Plugins

The package includes the plugins to minify according sources (see The package). You can define your own plugins for additional file types with the pgn option:

['pgn' => ['type' => flag]]

For example:

$obj = new PackApp(1, ['pgn' => ['sql' => false]]);

Place your plugin class into the plugins folder. Make it callable via static minify method like here:

Please contact if you would like to include your own plugin(s) into the package.

PHP obfuscation

The standard edition with the PackAppO add-on is required for the PHP obfuscation. It's recommended to follow certain naming rules in the planning and coding stage already to avoid the renaming conflicts (see below).

The php source is processed in two passes. 1st pass registers the identifiers found from the code during the minifying. 2nd pass performs cross-file renaming of the identifiers registered by 1st pass. The following identifiers can be replaced depending on the obf option:

The replacement can be case-insensitive (except variables/properties, heredocs/nowdocs, class constants).

PHP identifiers

Use the identifiers exclusion list (exi option) and follow the naming rules to avoid the identifiers' replacement conflicts:

  1. Be careful with the variable variables ($$var) or add their names to the exclusion list (see example).
  2. Don't use the variable names that are the same as any (system) object property name used in the application.
  3. The user constant name must not coincide with any system constant name used in the application.
  4. The element name which value is got via get/set magic methods from the array/object or is computed, must not be the same as any variable/property name used in application.
  5. Don't obfuscate the class/trait names which to be autoloaded, and class/method/function names specified in the callbacks, like call_user_func('myclass','mymethod').
  6. The identifiers prefixed by '__' are not obfuscated. You can use this for your identifiers exclusion too.
  7. Prefix your identifiers or add to exclusion list, if necessary, to follow (2,3,4,5).
  8. Be careful with the case-insensitive names of the functions, classes, traits and defined constants.
  9. Sample naming conventions:
    • variables, properties, constants - in camelCase;
    • heredocs, nowdocs - in UPPERCASE;
    • functions, methods, classes, traits - in PascalCase;

These rules are natural to follow and secure from the identifier name collisions. Use the dbg option to fix the renaming issues in the non-minified obfuscated result.

Installation

Unzip the obtained package and upload the files to your selected web directory. Then run example.php. The extended version requires the Setup before exploiting. It launches the installer automatically if not set up yet. Run PackApp.php from the browser to launch the installer directly.

The included example minifies/obfuscates the files from the tests.zip and outputs the result into the tests_pkd folder. A message informs about the result. The statistics collected by the packer are displayed and saved into example.txt.

Make a copy from the example.php and try it with different sources, destinations and options. Run index.php to launch the GUI supplied by an extended version.

Updates

The extended version supplies the version updates. The About section of the GUI displays the installation and update information and allows to edit your contact data. Run PackApp.php from the browser and click the Update button to check for the updates directly. Your contact data will be used for important product-related messages only. If your contacts change, please edit.

If the updating fails on any reason then the update.php and update.json files created allow to restore - run update.php.

The package

The plugins folder contains the minifiers adapted from the open source. The addons folder is not included in free version. The files list:

Special thanks to the authors referred. Please contact for any questions regarding the Packer.

ChangeLog


All versions of packapp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vregistry/packapp contains the following files

Loading the files please wait ....