maximkou / laravel-opcache-clear
This Laravel package allows you to clear the OPcache of a PHP application running in FPM mode with ease.
Installs: 5 456
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=5.5.9
- guzzlehttp/guzzle: ^6.2
- illuminate/console: ^5.0
- illuminate/http: ^5.0
- illuminate/support: ^5.0
This package is auto-updated.
Last update: 2024-12-17 17:40:09 UTC
README
This Laravel 5 package allows you to clear OPcache, solving a common problem related to cache invalidation during atomic deployments (also called "zero downtime deploy").
Getting Started
These instructions allows you to install the package into an existing Laravel app.
Prerequisities
Laravel 5 up&running installation.
Installation
You can install this package via Composer using:
composer require maximkou/laravel-opcache-clear
You must also install this service provider.
// config/app.php 'providers' => [ ... Maximkou\LaravelOpcacheClear\OpcacheClearServiceProvider::class, ... ];
Check that url
and key
options is right defined in your config/app.php
, example:
// config/app.php 'url' => env('APP_URL', 'http://my-app-url'), 'key' => env('APP_KEY'),
Usage
Once you have installed the package, you can run the following command (usually after deploy):
php artisan opcache:clear
All done! Your OPcache is resetted!
Customizations
Publish package config, if not published:
php artisan vendor:publish --provider="Maximkou\LaravelOpcacheClear\OpcacheClearServiceProvider"
All settings is placed in config/laravel-opcache-clear.php
- Change uri of cleaner action by editing
uri_slug
option (by default isopcache-clear
). - Change guzzle client options by editing
guzzle_options
options, to example, for disabling ssl verification:
'guzzle_options' => [ 'verify' => false, ]