neutrino / optimizer
The Neutrino Optimizer package.
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: ~4.8
- satooshi/php-coveralls: ~1.0
This package is auto-updated.
Last update: 2025-01-20 14:44:04 UTC
README
Optimize the composer autoload by using Phalcon\Loader.
How use :
$composerOptimizer = new \Neutrino\Optimizer\Composer( '{path to optimized loader file}', '{path to vendor/composer}', '{path to your base application path}', );
Optimize Memory
$composerOptimizer->optimizeMemory();
Memory optimizer use composer dumpautoload without " --optimize ".
This significantly reduces the size of the autoload_classmap.php file and therefore the size of the generated file. This implies that the classes will not have a direct path to their file, and thus an additional processing on the part of the autoloader (Phalcon \ Loader).
Optimize Process
$composerOptimizer->optimizeProcess();
Process optimizer use composer dumpautoload with " --optimize ".
This allows to load the autoload with the link each used. This generates a huge array that will accelerate the loading process of the class.
Autoload :
In your bootstrap file, Change your call of composer/autoload.php by :
// Load compiled autoloader. (Phalcon) if (file_exists("{path to optimized loader file}")) { require "{path to optimized loader file}"; return; } /** * Load composer autoloader. */ require "{path to vendor/composer/autoload.php}"