mvccore / packager
Library to pack any type of app into PHAR archive or any MvcCore app into single PHP super fast result file.
v2.5.1
2023-12-13 12:47 UTC
Requires
- php: >=5.4.0
- mrclay/minify: 2.3.*
README
Features
- pack PHP MvcCore application into single PHP file
- pack any PHP application into PHAR archive
Installation
composer require mvccore/packager
Configuration
- directory with whole app source to pack (
/development/...
) - result
index.php
file where to store packed result - no needs to define PHP scripts order anymore - automatic order detecting by reading PHP scripts
- exclude patterns by regular expressions to exclude any files or folders from app source
- string replacements applied on every packed PHP file before minimalization
- minimalizing PHTML templates
- minimalizing PHP scripts
- PHP packing has now 4 options, how implemented file system wrapping functions could behave:
- strict package mode (
\Packager_Php::FS_MODE_STRICT_PACKAGE
) (everything is only possible to get fromindex.php
, very fast for specific application types in IIS/PHP/op_cache) - strict hard drive mode (
\Packager_Php::FS_MODE_STRICT_HDD
) (no file system wrapping functions) - php library mode (
\Packager_Php::FS_MODE_PHP_LIBRARY
) (no file system wrapping functions, no PHP code replacements except namespace merge) - preserve php package mode (
\Packager_Php::FS_MODE_PRESERVE_PACKAGE
) (first there is check if it is possible to get anything fromindex.php
, then from hard drive) - preserve hard drive mode (
\Packager_Php::FS_MODE_PRESERVE_HDD
) (first there is check if it is possible to get anything from hard drive, then fromindex.php
)
- strict package mode (
- there are implemented those file system wrapping functions and constants:
__DIR__
and__FILE__
require_once();
,include_once();
,require();
,include();
new DirectoryIterator();
,new SplFileInfo();
readfile();
,file_get_contents();
file_exists();
,is_file();
,is_dir();
,mkdir()
,filemtime();
,filesize();
simplexml_load_file();
,parse_ini_file();
,md5_file();
- possibility to define which file system wrapping functions should be keeped and not wrapped
- for PHP packing - possibility to define files by extension how to store them inside
index.php
result- pure text
- php code
- binary
- gzipped content
- base64 encoded content