https://github.com/jderusse/composer-warmup
https://github.com/jderusse/composer-warmup
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jderusse/composer-warmup
- Owner: jderusse
- Created: 2016-06-03T21:40:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-18T17:52:48.000Z (almost 5 years ago)
- Last Synced: 2025-03-29T04:05:37.581Z (7 months ago)
- Language: PHP
- Size: 24.4 KB
- Stars: 181
- Watchers: 6
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
- awesome-composer - Composer-Warmup - The plugin adds the command `warmup-opcode` to Composer, which triggers the compilation of all PHP files discovered in your project into the Opcache. (Plugins / Support)
README
# OpCode Warmer (composer plugin)
Optimize your application by warming up OpCode.
## Requirements
- PHP `>=7.0`
- Zend extension [Opcache](http://php.net/manual/en/book.opcache.php)
- extension [Sockets](http://php.net/manual/en/book.sockets.php)
- composer `>=1.0.0`
## Install
```bash
$ composer global require "jderusse/composer-warmup"
```
## Configure
```ini
; /etc/php/7.0/cli/conf.d/10-opcache.ini
zend_extension=opcache.so
opcache.enable_cli=1
opcache.file_cache='/tmp/opcache'
; recommended
opcache.file_update_protection=0
```
## Usage
```bash
$ cd my-project
$ composer warmup-opcode
```
## How does it work?
Since PHP 7.0, the OpCache extension is able to store the compiled OpCode into
files.
This plugin adds the `warmup-opcode` command to
[composer](https://getcomposer.org/) which triggers the compilation for every
PHP file discovered in the project.
When you start the application for the first time, PHP doesn't need to compile
the files, which improve performance.