定制 utopia-php/fastly 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固