emgag / varnish-towncrier
varnish-towncrier 的 PHP 客户端
v1.3.0
2021-04-03 11:11 UTC
Requires
- php: >=7.3
- ext-json: *
- predis/predis: ^1.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^v2.18.4
- justinrainbow/json-schema: ^5.2
- phpstan/phpstan: ^0.12.82
- phpunit/phpunit: ^9
README
PHP 客户端用于 varnish-towncrier.
安装
composer require emgag/varnish-towncrier
使用方法
use Emgag\VarnishTowncrier\VarnishTowncrier; $client = new Predis\Client([ 'scheme' => 'tcp', 'host' => '127.0.0.1', 'port' => '6379' ]); $vb = new VarnishTowncrier($client); // BAN using a varnish VCL expression $vb->ban('example.org', 'expression'); $vb->ban('example.org', ['multiple', 'expressions']); // BAN using an URL pattern $vb->banURL('example.org', 'pattern'); $vb->banURL('example.org', ['multiple', 'patterns']); // PURGE using a path $vb->purge('example.org', 'path'); $vb->purge('example.org', ['multiple', 'paths']); // Purge cache surrogate keys $vb->xkey('example.org', 'key'); $vb->xkey('example.org', ['multiple', 'keys']); // Soft purge cache surrogate keys $vb->xkeySoft('example.org', 'key'); $vb->xkeySoft('example.org', ['multiple', 'keys']);
有关更多详细信息,请参阅 varnish-towncrier 的文档。
许可证
varnish-towncrier-php 在 MIT 许可证 下发布。