Generates a single PHP file containing all autoloaded classes to optimize performance for specific use cases.
Class Preloader is a PHP tool that generates a single compiled PHP script containing all classes required for specific application use cases. It improves performance by reducing the overhead of repeated autoloading, particularly beneficial for applications that execute the same bootstrap code on every request. The tool listens for autoloaded files, processes them with PHP Parser, and outputs a consolidated file.
PHP developers working on performance-critical applications where autoloading overhead is measurable, particularly those with predictable class usage patterns in request cycles.
Developers choose Class Preloader because it provides a straightforward way to optimize class loading performance without complex infrastructure changes. Its integration with Composer and configurable filtering make it adaptable to specific application needs while maintaining simplicity.
Optimizes class loading performance by generating a single PHP file containing all of the autoloaded files.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates a single PHP script containing all required classes, eliminating repeated autoloader calls and reducing I/O overhead, as highlighted in the README's description of outputting 'all autoloaded files in order'.
Uses nikic/PHP-Parser to traverse and analyze PHP files, ensuring precise class inclusion without manual dependency tracking, which is noted in the 'What it actually does' section.
Supports inclusive and exclusive regex filters to control class inclusion, allowing developers to tailor preloading to specific use cases, as described in the configurable filters feature.
Automates preloader generation via Composer scripts, enabling regeneration after dependency updates, which is demonstrated in the 'Automating the process with Composer' section.
Only beneficial for specific, predictable use cases; the README explicitly warns that 'tradeoff between preloading and autoloading' requires application-specific benchmarks, limiting broader utility.
Requires writing custom PHP config files with careful autoloader registration and dependency loading, adding setup overhead and potential for errors, as seen in the 'Writing a config file' instructions.
Preloaders must be regenerated when dependencies change, introducing an extra step in deployment that may not be fully automated for all workflows, despite Composer integration.