require 'contrib/cachetool.php';- cachetool (optional): accepts a string or an array of strings with the unix socket or ip address to php-fpm. If
cachetoolis not given, then the application will look for a configuration file. The file must be named .cachetool.yml or .cachetool.yaml. CacheTool will look for this file on the current directory and in any parent directory until it finds one. If the paths above fail it will try to load /etc/cachetool.yml or /etc/cachetool.yaml configuration file.set('cachetool', '/var/run/php-fpm.sock'); // or set('cachetool', '127.0.0.1:9000'); // or set('cachetool', ['/var/run/php-fpm.sock', '/var/run/php-fpm-other.sock']);
You can also specify different cachetool settings for each host:
host('staging')
->set('cachetool', '127.0.0.1:9000');
host('production')
->set('cachetool', '/var/run/php-fpm.sock');By default, if no cachetool parameter is provided, this recipe will fallback to the global setting.
If your deployment user does not have permission to access the php-fpm.sock, you can alternatively use
the web adapter that creates a temporary php file and makes a web request to it with a configuration like
set('cachetool_args', '--web --web-path=./public --web-url=https://{{hostname}}');Since APCu and OPcache deal with compiling and caching files, they should be executed right after the symlink is created for the new release:
after('deploy:symlink', 'cachetool:clear:opcache');
or
after('deploy:symlink', 'cachetool:clear:apcu');Read more information about cachetool on the website: http://gordalina.github.io/cachetool/
- cachetool (optional): accepts a string or an array of strings with the unix socket or ip address to php-fpm. If
cachetoolis not given, then the application will look for a configuration file. The file must be named .cachetool.yml or .cachetool.yaml. CacheTool will look for this file on the current directory and in any parent directory until it finds one. If the paths above fail it will try to load /etc/cachetool.yml or /etc/cachetool.yaml configuration file.set('cachetool', '/var/run/php-fpm.sock'); // or set('cachetool', '127.0.0.1:9000'); // or set('cachetool', ['/var/run/php-fpm.sock', '/var/run/php-fpm-other.sock']);
You can also specify different cachetool settings for each host:
host('staging')
->set('cachetool', '127.0.0.1:9000');
host('production')
->set('cachetool', '/var/run/php-fpm.sock');By default, if no cachetool parameter is provided, this recipe will fallback to the global setting.
If your deployment user does not have permission to access the php-fpm.sock, you can alternatively use
the web adapter that creates a temporary php file and makes a web request to it with a configuration like
set('cachetool_args', '--web --web-path=./public --web-url=https://{{hostname}}');Since APCu and OPcache deal with compiling and caching files, they should be executed right after the symlink is created for the new release:
after('deploy:symlink', 'cachetool:clear:opcache');
or
after('deploy:symlink', 'cachetool:clear:apcu');Read more information about cachetool on the website: http://gordalina.github.io/cachetool/
nullReturns Cachetool binary path if found. Otherwise, tries to install Cachetool to .dep/cachetool.phar.
:::info Autogenerated
The value of this configuration is autogenerated on access.
:::
:::info Autogenerated The value of this configuration is autogenerated on access. :::
Clears OPcode cache.
Clear opcache cache
Clears APCu system cache.
Clear APCu cache
Clears file status and realpath caches.
Clear file status cache, including the realpath cache