A Composer plugin that generates a preload script to warm up PHP's opcache, improving application performance.
Composer Preload is a Composer plugin that enhances PHP application performance by warming up the opcache. It introduces a `composer preload` command to generate a `vendor/preload.php` file, which compiles and caches specified PHP files into opcache, reducing runtime compilation overhead.
PHP developers working on performance-critical applications, especially those using frameworks like Drupal, Symfony, or Laravel, who want to optimize opcache usage during development or deployment.
Developers choose Composer Preload because it integrates seamlessly into the Composer workflow, providing flexible configuration for opcache warming without manual scripting, and it supports both CLI and server integration for automatic preloading.
Preload your sweet sweet code to opcache with a composer command, making your code faster to run.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Introduces a native `composer preload` command that fits into existing workflows, mirroring the pattern of Composer's autoloader for easy adoption and deployment integration.
Supports excluding directories and files using both paths and PCRE regex, as shown in the Drupal example to effectively skip test files without manual filtering.
From version v0.1.0, the generated preload.php uses relative paths, allowing it to be created on one server and reused on others with identical directory structures, simplifying multi-project setups.
The README explicitly warns that the plugin is in a 'very rudimentary state' and recommends against production use, indicating potential instability and lack of thorough testing.
Users must manually run the generated preload script via CLI or server setup after generation, and the roadmap notes the absence of an automatic run feature, adding deployment overhead.
Setting the exclude-regex option requires careful escaping for JSON syntax, making it error-prone and hard to debug, as admitted in the documentation with examples like '\/[' for slashes.