Download the PHP package qoliber/trident-php without Composer

On this page you can find all versions of the php package qoliber/trident-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package trident-php

Trident PHP Library

Official PHP client library for Trident HTTP Cache Proxy.

Requirements

Installation

Quick Start

Cache Purging

Purge by Tag

Purge by URL

Purge All

Convenience Methods

Cache Tags

Tag Collection

Tag Resolver

Durable invalidation for platform modules (1.3.0)

Platform-neutral building blocks shared by the platform integrations (WooCommerce today; Magento, Shopware, Sylius and PrestaShop next), so the delivery contract is written — and tested — once.

namespace what
Qoliber\Trident\Delivery X02/X03 delivery: Purger (record now with a grace period other drainers respect, deliver the process's own rows at the end of the request, remove only when acknowledged — safe for platforms that save without a transaction), Drainer, Packer (≤ 1000 tags per request), Backoff (1 s … 300 s, never gives up), Acknowledgement (HTTP 200 + int purged + string mode, optional state ≠ refused; or 202 + state: recorded in reflect mode), Instances/Instance (several Trident servers, each delivered and retried on its own), PurgeClient over a Transport, Psr18Transport
Qoliber\Trident\Tags TagSet: bounded (Trident's 200-tag default, a header byte budget), prioritised (identity > reference > listed), normalised tags with an overflow tag
Qoliber\Trident\Cache Policy / Decision / RequestContext: generic full-page cacheability rules; the platform passes its lists (state-changing query parameters, logged-in and session cookie prefixes)
Qoliber\Trident\Esi Markup::includeWithFallback() (<!--esi <esi:include/> --><esi:remove>inline</esi:remove>, src validated), FragmentUrl (signed fragment URLs), FragmentResponse::shared()/::private() (headers: own TTL and tags / never stored), TridentOrigin::matches() (did the request come from a Trident address)
Qoliber\Trident\Testing InMemoryOutboxStore, FakeTransport — test doubles other packages can reuse (they are in src/ because Composer never loads a dependency's autoload-dev)
assets/js/trident-sections.js the platform-neutral half of "private content from a local cache" (placeholders filled from localStorage under a version cookie); a platform binding configures it and serves the data endpoint

A platform provides two adapters and wires them:

TridentClient purge methods now also say whether Trident acknowledged the purge: PurgeResponse::isAcknowledged(), ->state, ->failure. The old isSuccess() is unchanged (true for any purge body) and must not be used to decide that a purge happened.

Admin screens for platform modules (1.4.0)

Everything a platform's admin needs to show and drive Trident — the screen set of the Magento module (dashboard, purge, cached pages, tags, coverage, warmer, launch, reflect, denoisers, bans, backends, discovery, live events) — with no per-platform API code.

class what
Qoliber\Trident\Admin\Api the ONE request path to an instance's admin API: bearer token (only when set), JSON in and out, an empty body sent as {} (the engine rejects []), errors mapped to ApiError, and one bounded retry when the admin rate limiter answers 429 with retry_after_ms (capped at 1 s). TridentClient and PurgeClient both use it
Qoliber\Trident\Admin\ApiError status (0 = no response), the engine's error code (REFLECT_DISABLED, LAUNCH_ACTIVE, …), isUnreachable(), isFeatureDisabled() (a 404 *_DISABLED or a 503 "… not enabled": show it as information, not a failure), reason() (never the token)
Qoliber\Trident\Admin\Fleet every configured instance (Instances::parse()): each() / on($names) run a call per instance and return one InstanceResult each — a dead instance is reported in its result, never thrown, so a screen still shows the live ones
Qoliber\Trident\Admin\Payload a never-throwing, dotted-path view of wide or growing responses (warmer, reflect, denoisers, coverage, explain, variants)
Qoliber\Trident\Admin\SiteUrl a storefront URL split the way the engine keys entries (path + host + scheme): the engine does not parse an absolute URL in url, and defaults the scheme to https

TridentClient::forInstance($instance, $transport) builds a client over any Transport (the WordPress HTTP API, Magento's Curl); new operator calls: status(), purgeHost(), purgeVary(), coverage(), cacheVariants(), explain(), warmerStatus|Run|Cancel|Queue(), launch(), reflectStatus|Enable|Disable|Queue(), denoiserReport(), denoiserPathZones(), denoiserQueryScopes(), denoiserQuery|PathPin(), …Unpin(), denoiserReset(), esiFragments(), and EventStream::parseChunk() for a bounded read of an SSE stream.

Corrected against the engine in the same release (each was checked on a live 1.8.0 Trident): the launch calls no longer append a launch id the engine does not have; memoryStats() reads GET /admin/memory; snapshot() and the discovery calls use the engine's paths; purgePreview() sends url_pattern/tag/tags/tag_pattern and reads would_free_bytes and the sample; cacheEntries()/cacheTags() gained the engine's sort/tag/prefix filters; CacheStatsResponse now carries hits, misses, passes and the hit ratio (it always reported 0 %); LaunchResponse reads the engine's success; list and entry responses read size, content_type, vary, and discovery reads backend_name/addresses. purgeUrl() splits an absolute URL into path, host and scheme.

1.4.1 — fixes

1.5.0 — a complete admin client

Everything a platform's admin screens need is now on the typed client; the lower-level Admin\Api is for what the library does not cover yet. Nothing is removed or renamed: 1.4.x code runs unchanged (the 1.4.1 test suite passes as-is).

TridentClientInterface is frozen for 1.x. The new methods (purge(), clearCache(), explainRequest(), wafExport(), the denoiser deletes) are on the TridentClient class only: adding methods to the interface would break every class that implements it. Type against TridentClient to use them.

Which layer to use (platform authors)

you need use
purges that must not be lost (a product save) Delivery\Purger + your OutboxStore — recorded with the change, delivered after commit, retried
one instance, one admin call Client\TridentClient (typed; raw()/payload() for any field)
the same call on every configured instance Admin\Fleet — one InstanceResult per instance, a dead one reported, never thrown
a purge with every engine option TridentClient::purge(PurgeRequest …)
an endpoint the client has no method for yet Admin\Api::call() — the one request path the client itself uses

1.8.1 — which Trident this is for

Packages are versioned in lockstep with the engine: MAJOR.MINOR is Trident's (library 1.8.x works with Trident 1.8), PATCH is the library's own. Qoliber\Trident\Compatibility::TRIDENT names the release line ('1.8'), and Compatibility::warning($engineVersion) returns a message for an admin screen when a connected engine runs another MAJOR.MINOR (null when it matches or is unreadable). The shared Admin\AdminService dashboard shows it as its "compatibility" row, so every platform built on it gets the warning.

1.8.0 (unreleased) — one delivery, settings and tag policy for every platform

Five public classes that were platform code before: Delivery\OutboxDelivery (record a purge per instance, flush this request's rows, drain, drainAll(), status, and a direct send when the outbox cannot be written), Config\Settings + Config\SettingsResolver (the deployment configuration wins over the admin setting; an environment token goes only to environment URLs; the host allowlist; purge mode, tag prefix, debug headers) and Tags\TagPolicy (the same tag names in the header and in the purge: prefix, 200 tags / 4 KiB, per-kind overflow tags). Used by trident-symfony and the PrestaShop module. A blank tag is now ignored instead of becoming the bare prefix. Integrations using them require ^1.8.

1.7.0 (unreleased) — the security pieces every platform needs

Moved out of the Shopware plugin, so the Sylius bundle (and every later platform) uses one implementation instead of a copy:

And, shared by the Shopware plugin and the Symfony bundle:

1.6.0

PSR-15 Middleware

Cache Tag Middleware

Cache Control Middleware

Environment Variables

Variable Description Default
TRIDENT_ADMIN_URL Trident admin API URL http://localhost:9100
TRIDENT_ADMIN_KEY Admin API authentication key null

Testing

Versioning

Versions follow Trident: qoliber/trident-php 1.8.x works with Trident 1.8. MAJOR.MINOR moves with the engine (every Trident X.Y.0 release is also a release of this package, changed or not); the PATCH number is this package's own. The admin screens warn when a connected Trident runs another release line.

License

MIT License - see LICENSE file for details.


All versions of trident-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-server-middleware Version ^1.0
psr/log Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package qoliber/trident-php contains the following files

Loading the files please wait ...