sergiusd / composer-warmup
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 14
Type:composer-plugin
Requires
- php: >=7.0
- composer-plugin-api: ^1.0
- ext-zend-opcache: *
- symfony/finder: ^3.3.10
This package is not auto-updated.
Last update: 2024-10-27 04:38:40 UTC
README
Optimize your application by warmuping OpCode.
Requirements
- PHP
>=7.0
- Zend Opcache
- composer
>=1.0.0
Install
$ composer global require "sergiusd/composer-warmup"
Configure
; /etc/php/7.0/cli/conf.d/10-opcache.ini zend_extension=opcache.so opcache.enable_cli=1 opcache.file_cache='/tmp/opcache' ; recommanded opcache.file_update_protection=0 opcache.validate_timestamps=0
Usage
$ cd my-project # autoload classmap $ composer warmup-opcode # autoload classmap and extra path $ composer warmup-opcode extra/path1 extra/path2 # extra path with extensions $ composer warmup-opcode --ext=php --ext=phtml extra/path1 extra/path2
How does it work ?
Since PHP 7.0, the OpCache extension is able to store the compiled OpCode into files.
This plugin add the warmup-opcode
command to
composer which triggers the compilation for every
PHP file discovered in the project.
When you start the application for the first time, PHP don't need to compile the files which improve performances, as you can see in this blackfire comparison.