germania-kg/clearcache-command

1.1.0 2023-01-04 14:34 UTC

This package is auto-updated.

Last update: 2024-09-04 18:06:35 UTC


README

Symfony 控制台命令,用于清除我们 Web 应用中的缓存。

[![测试](](https://github.com/GermaniaKG/ClearCacheCommand/actions/workflows/tests.yml)

安装

$ 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

单元测试和开发

  1. phpunit.xml.dist 复制到 phpunit.xml
  2. 像这样运行 PhpUnit
$ composer test
# or
$ vendor/bin/phpunit

还有更多在 composer.jsonscripts 部分中。