germania-kg / clearcache-command
PHP Package boilerplate
1.1.0
2023-01-04 14:34 UTC
Requires
- php: ^7.4|^8.0
- psr/cache: ^1.0|^2.0|^3.0
- symfony/console: ^5.0|^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- laminas/laminas-log: ^2.0
- php-coveralls/php-coveralls: ^2.0
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^8.0|^9.0
- spatie/phpunit-watcher: ^1.0
- symfony/cache: ^5.0
README
Symfony Console Command for clearing caches in our web apps.
[![Tests](https://github.com/GermaniaKG/ClearCacheCommand/actions/workflows/tests.yml/badge.svg)](https://github.com/GermaniaKG/ClearCacheCommand/actions/workflows/tests.yml)Installation
$ composer require germania-kg/clearcache-command:^1.0
Requirements
This package requires the Symfony Console component and the Psr\Cache interfaces.
Usage
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);
CLI usage
The command name is cache:clear
, and it accepts a --dry-run
option:
$ bin/console cache:clear $ bin/console cache:clear --dry-run
Development
$ git clone git@github.com:GermaniaKG/ClearCacheCommand.git
# or
$ git clone https://github.com/GermaniaKG/ClearCacheCommand.git
Unit tests and development
- 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.