utopia-php/fastly
Composer 安装命令:
composer require utopia-php/fastly
包简介
Fastly HTTP API client built on utopia-php/client
README 文档
README
Important
This repository is a read-only mirror of the utopia-php monorepo. Development happens in packages/fastly — please open issues and pull requests there.
A small Fastly API client for PHP 8.4+, built on utopia-php/client. It currently exposes surrogate-key purging.
Install
composer require utopia-php/fastly
Usage
<?php use Utopia\Client; use Utopia\Client\Adapter\Curl\Client as CurlAdapter; use Utopia\Fastly\Fastly; require __DIR__ . '/vendor/autoload.php'; $fastly = new Fastly( new Client(new CurlAdapter()), // any PSR-18 client serviceId: 'SU1Z0isxPaozGVKXdv0eY', token: 'your-fastly-api-token', ); // Invalidate every response tagged with this surrogate key. $fastly->purge('homepage');
purge() issues POST {endpoint}/{serviceId}/purge/{surrogateKey} with the API
token in the Fastly-Key header. A non-2xx response raises
Utopia\Fastly\Exception\PurgeException; network failures surface as the
underlying PSR-18 client exceptions.
The endpoint (https://api.fastly.com/service) and token header (Fastly-Key)
are constructor arguments, so the client also works against a compatible proxy:
$fastly = new Fastly($client, $serviceId, $token, 'https://cdn.internal/service', 'X-Purge-Key');
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-20