Skip to content

Instantly share code, notes, and snippets.

@jonaseberle
Last active December 9, 2021 16:55
Show Gist options
  • Save jonaseberle/9bfc29b3af726c41b3cd9cec088fc722 to your computer and use it in GitHub Desktop.
Save jonaseberle/9bfc29b3af726c41b3cd9cec088fc722 to your computer and use it in GitHub Desktop.
use gordalina/cachetool in typo3/surf
# composer req gordalina/cachetool
# example for using it via HTTP if php-fpm not accessible (use --fcgi[=/run/...|=127.0.0.1:9000] if you can)
$deployment
->defineTask(
'CachetoolTask',
ShellTask::class,
[
'command' => [
'export cacheToolParams="--web=SymfonyHttpClient --web-allow-insecure --web-url='
. escapeshellarg($application->getOption('baseUrl')) . ' --web-path=./public/ --web-host"',
'cd {releasePath}',
'eval vendor/bin/cachetool apcu:cache:clear $cacheToolParams',
'eval vendor/bin/cachetool opcache:reset $cacheToolParams',
'eval vendor/bin/cachetool stat:clear $cacheToolParams', // to my knowledge this will only clear for the current PHP process?!
'eval vendor/bin/cachetool stat:clear --cli',
],
'logOutput' => true,
'ignoreErrors' => false,
]
)
->beforeTask( // stage "switch"
FlushCachesTask::class,
'CachetoolTask'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment