Symfony Console Command for clearing caches in our web apps.
[](https://github.com/GermaniaKG/ClearCacheCommand/actions/workflows/tests.yml)$ composer require germania-kg/clearcache-command:^1.0
This package requires the Symfony Console component and the Psr\Cache interfaces.
The ClearCacheCommand clears app cache directories and PSR Cache Item Pools:
use Germania\ClearCache\ClearCacheCommand;
$directories = array();
$psr_cacheitempools = array();
$cmd = new ClearCacheCommand($directories, $psr_cacheitempools);
The command name is cache:clear
, and it accepts a --dry-run
option:
$ bin/console cache:clear
$ bin/console cache:clear --dry-run
$ git clone git@github.com:GermaniaKG/ClearCacheCommand.git
# or
$ git clone https://github.com/GermaniaKG/ClearCacheCommand.git
- Copy
phpunit.xml.dist
tophpunit.xml
- Run PhpUnit like this:
$ composer test
# or
$ vendor/bin/phpunit
And there's more in the scripts
section of composer.json.