germania-kg / clearcache-command
PHP 包模板
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 控制台命令,用于清除我们 Web 应用中的缓存。
[安装
$ composer require germania-kg/clearcache-command:^1.0
要求
此包需要 Symfony 控制台 组件和 Psr\Cache 接口。
使用方法
ClearCacheCommand 清除应用程序缓存目录和 PSR 缓存项池
use Germania\ClearCache\ClearCacheCommand; $directories = array(); $psr_cacheitempools = array(); $cmd = new ClearCacheCommand($directories, $psr_cacheitempools);
CLI 使用
命令名称为 cache:clear
,并接受 --dry-run
选项
$ 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
单元测试和开发
- 将
phpunit.xml.dist
复制到phpunit.xml
- 像这样运行 PhpUnit
$ composer test # or $ vendor/bin/phpunit
还有更多在 composer.json 的 scripts
部分中。