diff --git a/recipe/common.php b/recipe/common.php index be12d04d6..e1166d829 100644 --- a/recipe/common.php +++ b/recipe/common.php @@ -12,6 +12,7 @@ require __DIR__ . '/deploy/lock.php'; require __DIR__ . '/deploy/push.php'; require __DIR__ . '/deploy/release.php'; +require __DIR__ . '/deploy/reset_opcache.php'; require __DIR__ . '/deploy/rollback.php'; require __DIR__ . '/deploy/setup.php'; require __DIR__ . '/deploy/shared.php'; diff --git a/recipe/deploy/reset_opcache.php b/recipe/deploy/reset_opcache.php new file mode 100644 index 000000000..c634fe806 --- /dev/null +++ b/recipe/deploy/reset_opcache.php @@ -0,0 +1,38 @@ + {{reset_opcache_document_root}}/reset_opcache-{{reset_opcache_nonce}}.php', env: ['PHP_OPCACHE_RESET_SCRIPT' => $phpScript]); +}); + +desc('Execute PHP OPcache Reset'); +task('deploy:reset_opcache:execute', function () { + $result = fetch("{{reset_opcache_app_url}}/reset_opcache-{{reset_opcache_nonce}}.php"); + if ($result !== 'success') { + throw error('Reset PHP OPcache failed!'); + } +}); + +desc('Reset PHP OPcache'); +task('deploy:reset_opcache', [ + 'deploy:reset_opcache:prepare', + 'deploy:reset_opcache:execute', +]);