jeslopcru / varnishadmin
Varnish 管理套接字,用于执行 varnishadm CLI 命令
dev-master
2018-04-14 07:29 UTC
Requires
- php: >5.6
Requires (Dev)
- phpunit/phpunit: ^4.7.6
This package is not auto-updated.
Last update: 2024-09-26 12:51:05 UTC
README
VarnishAdmin 是一个用于使用 PHP 管理反向代理缓存命令的 PHP 库
需求
VarnishAdmin 支持 PHP 5.6.* 及以上版本。
安装
要安装此包,请运行以下命令,您将获取最新版本
composer require jeslopcru/varnishadmin
或者将其包含在您的 composer.json 中
{
"require": {
"jeslopcru/varnishadmin": "dev-master"
}
}
使用
使用 VarnishAdmin 非常简单。如果您有任何问题,请打开一个 issue
Varnish 5
$varnish = new VarnishAdminSocket('192.168.10.10', 6082, '5.0.0'); $varnish->purgeUrl('example.com'); $varnish->quit();
Varnish 4
$varnish = new VarnishAdminSocket('192.168.10.10', 6082, '4.0.3'); $varnish->purgeUrl('example.com'); $varnish->quit();
Varnish 3
//purge postId (id = 354) //www.example.com?id=354 $varnish = new VarnishAdminSocket(); $varnish->purgeUrl('id=354'); $varnish->quit();
拉取请求
欢迎使用 PSR-2 标准的拉取请求,所有问题都欢迎
许可证
整个 VarnishAdmin 包是在 MIT 许可下发布的,请参阅 LICENSE。
您可以使用此仓库为 Docker: https://github.com/newsdev/docker-varnish