Search by

detain / phlix-plugin-example

detain

Hello-world metadata provider — reference plugin for Phlix authors.

Package info

github.com/detain/phlix-plugin-example

Type:phlix-plugin

pkg:composer/detain/phlix-plugin-example

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1.2 2026-11-03 22:05 UTC

This package is auto-updated.

Last update: 2026-12-03 05:39:52 UTC


README

tests

Reference metadata-provider plugin for Phlix — the smallest plugin that demonstrates the wiring a real host (the running phlix-server instance) consults.

This repo is the canonical hello-world template for Phlix plugin authors. It does almost nothing on purpose — but it is wired exactly like a real plugin:

  • it implements the three shared contracts a metadata provider is consulted through (LifecycleInterface + ConfigurableInterface + MetadataSourceInterface);
  • it answers the metadata triad with a fixed greeting for one well-known fixture, and delivers the manifest greeting setting through configure();
  • it ships with a CI workflow plus PHPUnit tests, so you can fork it as a starter.

Read "What it does" below for the call-path tour — lookup() is a didactic helper the host never calls, and the live call paths are named there.

What it does

The host drives this plugin through three contracts, all implemented:

  • Lifecycle — Phlix\Shared\Plugin\LifecycleInterface (onEnable(), onDisable(), subscribedEvents()): the instantiate/enable/disable contract the loader runs every plugin through.
  • Settings delivery — Phlix\Shared\Plugin\ConfigurableInterface (configure(array $settings)). Per the loader's own words this is "the ONLY channel by which a plugin receives its configured API keys/options" (Phlix\Plugins\PluginLoader in phlix-server, applied once between construction and onEnable()). That is how an operator's greeting change reaches the instance: plugin.json seeds the persisted settings store at install, the admin Plugins panel edits the stored value, and configure() delivers that store — and it is the seam this template exists to demonstrate. The ordering ceremony is pinned from both sides: test_recording_entry_observes_configure_before_on_enable() replays the loader's call order through a recording entry double, and test_configured_greeting_survives_the_enable_ceremony() drives the real provider through configure() → onEnable() and reads the delivered greeting back.
  • Metadata pipeline — Phlix\Shared\Metadata\MetadataSourceInterface (sourceName(), supportedMediaTypes(), search(), getDetails(), getImages()). PluginLoader::enable() registers an entry instance into the metadata SourceRegistry only when it is instanceof that interface — a clone that drops it installs and enables but is never consulted.

Through the triad, the reference source is example (sourceName(), the slug an admin adds to a metadata.provider_priority list), it is registered for movie items (supportedMediaTypes()), and its methods answer as follows:

  • search('hello') returns [['id' => 'hello', 'title' => 'Hello, World']] — the fixture, best-match first; any other query returns [].
  • getDetails('hello') returns ['title' => 'Hello, World']; any other id returns []. It routes through lookup(), below, so the fixture shape lives in one place.
  • getImages() always returns [] — the reference ships no artwork, and an empty map is the contract-legal way to say so.

lookup() is a didactic method: the host never calls it. There is no plugin-entry lookup() call site anywhere in phlix-server/src. It is the shape this template shipped before the triad wiring landed, kept as the fixture helper getDetails() delegates to — calling lookup('/test/hello.mkv') returns ['title' => 'Hello, World'] (any other path []), but the live path into that code is the triad above. Forkers replace the triad bodies, not lookup() alone.

The live metadata plugins (e.g. phlix-plugin-omdb) show the production arms of the same triad; the developer guide tours the contracts.

Dated caveat (2026-12-01) on that guide (phlix-docs/docs/plugins/developer-guide.md): its tour of this template predates the current code in four places. (1) Its file-by-file tour and §10 still teach the dev-stubs/ fallback pattern; those stubs were retired from this repo once detain/phlix-shared became a hard Composer dependency (see AGENTS.md, "Known drift"). (2) Its composer.json tour and pin advice say PHP >=8.1; this template requires >=8.3 (Requirements below). (3) Its install example pastes a .../phlix-plugin-example/main/plugin.json raw URL — main/ 404s; this repo's only branch is master, so use the master/ form. (4) Its entry-class tour frames lookup() as the contract method, a framing that predates the triad: the live path is the triad above and lookup() is didactic. Where the guide and this README disagree, trust this README and the code; the correction lives with the guide's own repo (detain/phlix-docs).

Manifest type

This template declares "type": "metadata-provider" in plugin.json. The value is validated and persisted by the host but never branches registration: the interfaces the entry class implements decide what gets wired. The plugin-manifest skill's Type→contract map section (.claude/skills/plugin-manifest/SKILL.md) maps all eleven schema types to their required interfaces and host registries, with phlix-server line numbers as of 2026-12-01.

Install

The plugin is unsigned by design (signature: null) — the host logs a warning and proceeds, because the trusted-key allowlist ships empty. Install into a running Phlix server:

  1. Log in as an admin user (users.is_admin = 1).

  2. Open the admin Plugins section at /app/admin/plugins (the legacy /admin/plugins path redirects there).

  3. Use the Install from URL panel. The installer accepts three flavours: a repository URL (rewritten to its default-branch tarball by SourceUrlResolver), a direct archive URL (*.zip, *.tar.gz, *.tgz), or a stub plugin.json whose source field points at such an archive.

    What works today:

    • Local archive (the procedure verified step by step when this fix landed): from one directory above your checkout, package it (a single root directory is flattened automatically):

      tar czf /tmp/phlix-plugin-example.tar.gz \
          --exclude='*/vendor' --exclude='*/.git' phlix-plugin-example

      paste file:///tmp/phlix-plugin-example.tar.gz, or run the same install from the server's CLI (from the phlix-server install directory):

      php bin/phlix plugin:install file:///tmp/phlix-plugin-example.tar.gz

      file:// sources are exempt from both the HTTPS-only gate and the pin requirement below — they are operator-local bytes.

    • A remote archive that answers 200 with no redirect (e.g. a self-hosted artifact download ending in .tar.gz/.zip), or a stub plugin.json whose source names one. Remote, un-pinned sources are refused by the loader's default-deny (SV-S2b — a review-ledger id for that finding): Refusing to install unverified plugin source … — unless the source matches a catalog entry carrying ref + artifactSha256 (this repo is listed in the official detain/phlix-plugins catalog), or the operator sets PHLIX_PLUGINS_ALLOW_UNVERIFIED=1 as an escape hatch (logs a warning). A catalog install click resolves to a github.com/.../archive/... fetch, so the curated path rides the vetted hop described below on a host that carries it — the cure was cut for exactly that dev-channel install, and following GitHub's canonical Location (rather than raw codeload aliases) keeps the bytes equal to the catalog's artifactSha256 pins. On a host build without the hop the curated click still dies at the 302 refusal below. HTTPS-only applies unless PHLIX_PLUGINS_ALLOW_HTTP=1 (the admin endpoint stays HTTPS/file://-only regardless).

    ⚠ A GitHub URL paste completes only on a server build that carries the vetted-archive-hop cure — on phlix-server master since 2026-11-05 (45922861). Every https://github.com/OWNER/REPO/archive/… URL answers 302, and the R20-02 SSRF gate (a review-ledger id) still refuses redirects before extraction — with exactly one vetted exception, checked as a pure header predicate (vettedGitHubArtifactRedirect) ahead of the refusal: a single 3xx whose lone Location names https://codeload.github.com/{same owner}/{same repo}/ in the tar.gz/zip shape with a non-empty ref (no port, userinfo, query or fragment) is re-requested as one terminal leg under every other unchanged gate. A second redirect, a mismatched owner/repo, or any foreign redirect target is still refused byte-identically: HTTP redirects are not allowed (received HTTP/1.1 302 Found). No release tag carries the cure yet (newest at this writing, v1.2.3, predates it), so on a released host a GitHub paste still fails; derive the boundary the way Fork as a starter step 2 teaches — git describe --contains 45922861 in a phlix-server checkout names the first tag shipping the hop (until the next cut it errors, and that error is itself the answer: no released build has it). The recipe this README used to print — paste the raw.githubusercontent.com/.../main/plugin.json URL — fails twice over regardless of any cure: the branch is master (that URL 404s), and even corrected, this manifest has no source field, so the stub arm throws Stub plugin.json must contain a "source" field pointing at a tarball or zip.

  4. The server downloads (or copies) the archive, validates the manifest with Phlix\Plugins\Manifest\ManifestSchema against the JSON Schema bundled in detain/phlix-shared, checks phlix_min_server_version, verifies any signature, runs composer install --no-dev (with --no-scripts --no-plugins — the host's RCE kill-switch for install hooks), and stores a row in the plugins table. The plugin lands disabled by default.

  5. Flip the toggle in the table to enable it.

The same operations are reachable via the JSON API — POST /api/v1/admin/plugins/install with body {"url": "..."}, then POST /api/v1/admin/plugins/{name}/enable; see docs/plugins/install-from-url.md for the curl recipes, and docs/plugins/install-from-catalog.md for the curated one-click path.

Use

On a live host, install and enable the plugin (see Install); the loader configures it from the persisted settings and registers it as the example metadata source, so search('hello') / getDetails('hello') answer for movie items — with the operator's greeting override applied.

The in-process demo below mirrors that host path, and tests/HelloMetadataProviderTest.php pins it line for line (test_readme_in_process_demo_holds) alongside behavioral tests for the configure() absorb rule (missing, empty-string and non-string greeting values keep the last good greeting) and the search() → getDetails() pair. The block below is a complete PHP file — header and autoloader included — so it runs as written from the repo root once composer install has resolved detain/phlix-shared:

<?php
require 'vendor/autoload.php';

$provider = new \Phlix\PluginExample\HelloMetadataProvider();
$provider->configure(['greeting' => 'Bonjour, Monde']); // the host's settings channel
$provider->getDetails('hello');   // ['title' => 'Bonjour, Monde']
$provider->lookup('/test/hello.mkv'); // ['title' => 'Bonjour, Monde'] (didactic helper)
$provider->lookup('/anything/else');  // []

The fixture path lives at Phlix\PluginExample\HelloMetadataProvider::FIXTURE_PATH if you want to reference it from tests.

Settings

plugin.json is the canonical source for the keys below — it carries the declaration and the default the host seeds into its persisted settings store at install (PluginLoader::defaultSettings() and updateSettings() in phlix-server). The admin Plugins panel's configure form edits the stored values (PUT /api/v1/admin/plugins/{name}/settings), and the loader delivers the store to the instance through configure() alone.

Setting Label Type Required Default Edit path Description
greeting Greeting string No Hello, World admin Plugins panel → configure form Title this metadata source returns for the demo fixture. Demonstrates the settings seam: the host delivers the persisted value through ConfigurableInterface::configure().

The Default cell is copied from plugin.json (settings.greeting.default), and tests/ManifestContractTest.php pins that default to the class's DEFAULT_GREETING constant — edit plugin.json first and mirror the change here and in the constant.

An unusable stored greeting (a missing key, a non-string, or the empty string) never aborts enabling: configure() keeps the last good value and emits one error_log() line naming the setting key and the received value's get_debug_type() — never the value itself, per the logging rule under Settings & secrets — so a misconfigured store is visible in the server log instead of presenting as a greeting that silently refuses to change.

Settings & secrets

A real fork outgrows the demo quickly — usually by adding an upstream API key (TMDB, TVDB, Fanart.tv, the classic metadata sources). The configure() seam itself is demonstrated above (it is how the greeting arrives); the network rules this template cannot demonstrate are stated here instead of being left to each cloner's improvisation:

  • A secret has no place in the manifest. plugin.json ships in your public archive and is the bytes the installer fetches; a default carrying a real key leaks it to every clone. Declare the key with "secret": true and "default": null — required: true is still fine: the host null-fills (see the Note in Fork as a starter step 2) — exactly the shape phlix-plugin-omdb uses for its api_key.
  • "secret": true is the blessed config seam. Only flagged keys are host-managed secrets: the admin API (GET /api/v1/admin/plugins/{name}) renders their stored values masked (*** — Phlix\Plugins\SettingsMasker server-side), and the configure-form save keeps the stored secret when the UI round-trips the mask sentinel unchanged. A key declared without the flag round-trips visibly through admin surfaces — the flag, not the key's name, is what makes a setting a secret.
  • Read keys only through configure(). Phlix\Shared\Plugin\ConfigurableInterface::configure(array $settings) is, per the loader's own words, "the ONLY channel by which a plugin receives its configured API keys/options" (phlix-server/src/Plugins/PluginLoader.php). Stash it in a private property; never write the whole settings array — or any one secret value — into a log line.
  • Never let a raw secret reach an output surface, including strings you return as title and URLs you print on failure. When the upstream demands the key in a query string, redact it on every log/exception surface — OmdbApi::MASKED_APIKEY + redactSecrets() in phlix-plugin-omdb are the reference.

Outbound calls

HelloMetadataProvider never touches the network; your replacement probably will. The estate posture to copy (the estate: Phlix's family of official detain/phlix-plugin-* repos) — demonstrated by the live metadata plugins, not by this demo:

  • https, with no runtime exception. The installer is HTTPS-only (SV-S2b — see Install above); mirroring that gate in your own calls costs nothing: pin an https:// base URL as a constant (OmdbApi::API_BASE).
  • Explicit timeout, TLS verification enabled. Use the HTTP client the host runtime already carries — Workerman\Http\Client, constructed with 'timeout' => … (OmdbApi::HTTP_TIMEOUT_SEC flows through as exactly that option) — and never silently disable certificate verification. phlix-plugin-omdb defaults verification enabled and exposes use_ssl_verification as a deliberate advanced opt-out that logs a warning once when disabled; its HTTPS-only gate holds on every transport, including its bounded cURL backstop, either way. Never reach for file_get_contents() or a raw socket without a timeout: a blocking call with no bound can stall the worker process your plugin shares with the host.
  • Bound your own retries. OmdbApi::enforceRateLimit() shows a plugin staying inside its upstream's contract; retry storms are the plugin's problem, not the provider's burden.
  • Honour Retry-After on 429 — with bounds both ways. phlix-plugin-anilist's HttpClient obeys the header but raises short values to a floor (MIN_RETRY_AFTER_SEC = 1.0 — a 429 that asks for a zero-delay retry must never produce one) and caps the automatic retries; phlix-plugin-myanimelist clamps the header to MAX_RETRY_AFTER_SEC = 300.0; phlix-plugin-lastfm clamps at MAX_RETRY_AFTER_SECONDS = 3600, because a literal Retry-After: 31536000 would otherwise park a queued scrobble for a year. Trust the header's direction, clamp its magnitude.
  • Identify yourself: send a descriptive User-Agent. Six plugins stamp one deliberately — phlix-plugin-trakt sends phlix/trakt (+https://github.com/detain/phlix-plugin-trakt) on every request, phlix-plugin-anilist stamps its USER_AGENT constant likewise, phlix-plugin-myanimelist carries the plugin version in it, phlix-plugin-opensubtitles' API terms require a contact identity in the UA, phlix-plugin-lastfm stamps the same phlix/<name> (+URL) idiom (its URL points at the phlix-server repo — a nit, but still a stamp), and phlix-plugin-musicbrainz treats it as config: a DEFAULT_USER_AGENT constant surfaced as a user_agent plugin setting — MusicBrainz policy requires a descriptive contact UA — sanitised at the settings boundary before any request. phlix-plugin-omdb is the sole exception: it rides the vendor default — not the part to copy. An anonymous UA gets your plugin rate-limited or blocked on some other tenant's misbehaviour, with no way for the provider to reach you.
  • Defensive decoding must surface contract drift, not normalise it to empty. When an upstream renames a field or reshapes its envelope, a decoder that coerces the surprise into [] hides the break forever: the host reads an empty result as a legitimate miss and moves on (PluginSourceConsultation.php:90/:100), so the outage never becomes visible. phlix-plugin-musicbrainz's HttpResponse names the cost of silence — it once dropped ETag and Retry-After headers, and it now classifies 429/503 explicitly as rate-limit ("the caller must back off"). Throw on a shape you did not contract for: the consult loop isolates a throwing source with one warning and consults the next one — loud is recoverable, silent-empty is not.
  • Keep "error" and "no match" distinct. [] from search() or getDetails() means this provider has nothing for this item — the contract-legal empty map this demo itself returns. A transport failure, a 5xx, or rate-limit exhaustion means unknown, and it must reach the host as a throw: PluginSourceConsultation::consult() catches per source (full path cited under the call budget below), logs one warning, and lets the next source answer. phlix-plugin-lastfm's LastfmOutcome is the granular shape — transient failures (transport drops, 429, 5xx) are typed apart from terminal ones. Returning [] on error teaches the host your catalog is empty when the network is down.
  • Separate sandbox and production endpoints explicitly. Where an upstream offers a sandbox host, name both base URLs as constants (https://, per the first bullet), switch only through an explicit setting, never fall back between them silently, and never send production credentials to a sandbox host or sandbox ones to production. No live estate plugin needs a sandbox today — this leg exists for the fork whose API has one.
  • Prefer header auth over query-string auth. When the upstream accepts it, ride a header — phlix-plugin-opensubtitles sends Authorization: Bearer <session token>, as do the OAuth plugins. A key in the query string leaks into every URL surface: phlix-plugin-omdb's apikey rides the query (http_build_query in OmdbApi), and that is precisely why it must ship MASKED_APIKEY + redactSecrets() to scrub the key out of every log line and exception. If your API allows only query keys, copy omdb's redaction discipline before writing the first http_build_query.
  • workerman/http-client belongs in require-dev, not require. The host runtime already carries Workerman, so the client is a build-time symbol, not a shipped dependency: phlix-plugin-omdb and phlix-plugin-lastfm declare workerman/http-client under require-dev (omdb also declares workerman/workerman there; lastfm does not) — that is what lets composer phpstan (level 9 over src/, as in this repo's phpstan.neon) resolve Workerman\Http\Client without your plugin shipping its own copy of the host's event loop.

The call budget — the host calls you per item, per source, on live paths. One search() plus one getDetails() is the minimum per source: PluginSourceConsultation::consult() (phlix-server/src/Media/Metadata/Resolution/PluginSourceConsultation.php:82-115) walks orderedSources() (:133-150), which runs the metadata.provider_priority list first and then continues through every remaining registered source of the item's media type. Those consults ride the resolution and match paths — MovieMetadataResolver/SeriesMetadataResolver, the once-per-item PluginMetadataEnricher, and matching driven from the HTTP controllers — so a browser action can fan out behind you. Your real budget is therefore items × sources × calls-per-source, and the only cushion is MetadataManager's hasRecentMetadata() freshness gate (src/Media/Metadata/MetadataManager.php:461, :628 — metadata.cache_ttl_hours, shipped default 24 hours) — and a forced refresh ($force) bypasses even that. Budget every upstream call like a rate-limited API must survive a whole-library pass, not just one detail page.

Events

The host dispatches PSR-14 events (psr/event-dispatcher; in phlix-server, Phlix\Common\Events\ListenerRegistry is the subscribe facade and EventDispatcherFactory builds the dispatcher from it). The producers are real runtime moments: playback transitions (src/Session/PlaybackController.php:857 dispatches PlaybackStarted, :881/:905/:950 the pause/resume/stop counterparts), library scans (src/Media/Library/MediaScanner.php:3567 LibraryScanStarted, :3621 MediaItemAdded), and user sessions (src/Auth/AuthManager.php:2807 UserLoggedIn). The shared event classes ride three manifest alias families — phlix.playback.*, phlix.library.*, phlix.user.* — translated by Phlix\Shared\Plugin\EventNameMap in detain/phlix-shared.

A provider subscribes through the lifecycle contract: the loader calls subscribedEvents() once onEnable() has returned, and attaches every event FQCN => handler pair to the registry, where a handler is either a method name on the entry instance (the loader binds it as [$instance, $method] — PluginLoader::resolveCallable) or any PHP callable. The one line a listening fork would add:

public function subscribedEvents(): array { return [\Phlix\Shared\Events\Library\MediaItemAdded::class => 'onMediaItemAdded']; }

This reference class subscribes to none — deliberately. subscribedEvents() returns [] (pinned by test_subscribed_events_is_empty) and plugin.json declares events: [] to match; tests/ManifestContractTest.php pins the two sets equal, so an entry class that starts listening without updating its manifest reddens the build. The reason the reference can stay silent is that a metadata provider never needs the dispatcher to be reached: the host consults the triad by direct call (PluginSourceConsultation — see The call budget above), and no event is required to answer one. Listeners are for the moments the triad cannot see — invalidating your own caches on phlix.library.item.updated, mirroring session state on phlix.user.* — and the fail-fast law tying manifest aliases to subscribedEvents() is stated under Fork as a starter step 2.

Fork as a starter

This repository is intentionally small (one PHP class, three test files plus a bootstrap) so you can copy it as the seed for your own plugin:

  1. Fork or git clone this repo, then rename the new directory.

  2. Edit plugin.json — pick a new name (must start with phlix-plugin-), set version, change entry to your FQCN, and set phlix_min_server_version to an honest floor: the oldest Phlix server release that carries every feature your code relies on. Derive it from the server's history instead of guessing — in a checkout of phlix-server, run git describe --contains <feature-sha> for the commit that introduced each seam you use, and keep the oldest tag any of them returns. This template's own two load-bearing seams — typed metadata-source registration through SourceRegistry (63c5666a) and settings delivery on enable via ConfigurableInterface::configure() (de6ce093) — both land inside v1.2.0, which is why this repo declares 1.2.0 (the same floor its sibling reference plugins phlix-plugin-anilist and phlix-plugin-trakt pin). Do not conflate that with the shared-pin era: the detain/phlix-shared constraint in composer.json (here ^0.59.0) covers the build-time contracts — MetadataSourceInterface exists in shared since v0.15.0 and ConfigurableInterface since v0.18.0, both well inside ^0.59.0 — while phlix_min_server_version speaks about the running server: a plugin compiled against a recent shared may only claim an older floor if the server-side seams it calls were actually shipped there. The events aliases you may declare there are validation metadata: the host's fail-fast check validates each alias against Phlix\Shared\Plugin\EventNameMap's real families (phlix.playback.*, phlix.library.*, phlix.user.* — there is no phlix.auth.* family); what actually subscribes your listeners is your entry class's subscribedEvents(). The manifest schema is the JSON Schema bundled in detain/phlix-shared/schemas/manifest.schema.json; the key-by-key guide is docs/plugins/manifest.md.

    Note: If you declare a setting required:true, give it a default or the host will null-fill it — see docs/plugins/manifest.md. Settings only ever reach your instance through ConfigurableInterface::configure().

  3. Edit composer.json — rename the package, change the PSR-4 prefix under autoload.psr-4. The repositories entry (a vcs source for detain/phlix-shared) exists only because that package is fetched from GitHub; drop it, or replace it with your own source, once you resolve phlix-shared from Packagist.

  4. Rewrite src/HelloMetadataProvider.php with your own implementation, keeping onEnable() cheap and doing the heavy work behind the contract methods. That heavy work must be loop-safe: the host calls those contract methods per item, per source, on the request path — see the call budget under Outbound calls — so budget every upstream call like it fires inside a scan you do not control. The reference class already implements the interfaces your manifest type is consulted through (metadata providers: MetadataSourceInterface, settings via ConfigurableInterface) — keep the interfaces and replace their bodies with real upstream calls. The didactic lookup() helper is the one piece you may drop: the host never calls it, so a fork that keeps only that shape installs and enables but is never consulted. Edit the SOURCE_NAME constant ('example') alongside any class rename: sourceName() returns it, and it is the slug the host keys your source on in metadata.provider_priority. If the new class needs an API key or calls an upstream service, follow Settings & secrets and Outbound calls above — do not improvise key handling.

  5. Replace the tests in tests/ to match — but keep tests/SecurityAuditCheckTest.php, scripts/security-audit-check.php and the composer-audit job in .github/workflows/test.yml. Those three are the estate's whole-lock audit gate, and the guard test reddens your build if you neuter it. Two fork chores ride with it:

    • Re-measure your own composer.lock and re-pin both floors in scripts/security-audit-check.php (MIN_AUDITED_PACKAGES and MIN_AUDITED_DEV_PACKAGES), updating the guard test's restated copies (MIN_PACKAGES/MIN_DEV_PACKAGES in tests/SecurityAuditCheckTest.php) in the same commit — the values here are measured on this repo's lock, and testFloorsMatchTheScript() reddens when the two copies disagree.
    • Delete scripts/add-headers.php, or re-parameterize its @copyright line with your own name before running it — as shipped it stamps this repo's author onto every file.
  6. Publish so the install flow can fetch you: a direct-200 archive URL (or a stub plugin.json carrying a source field that names one), plus a catalog pin for remote sources — the loader's default-deny applies to every remote fetch regardless. On a server build that carries the vetted hop (Install above), a plain GitHub archive URL paste also installs, which covers dev-channel testing against your own repo.

The plugin developer guide has the full walkthrough, including the lifecycle diagram and the manifest event alias table:

The dated caveat under What it does (2026-12-01) names the four places where the developer-guide tour above lags this template.

Requirements

  • PHP >= 8.3 — the only declared source of the floor is composer.json ("php": ">=8.3"); CI exercises both 8.3 and 8.4 (.github/workflows/test.yml, the phpunit job matrix php).
  • Composer — pulls the build-time contracts (detain/phlix-shared) and the gate tooling (PHPUnit, PHPStan, PHPCS) that the section below runs.
  • A running Phlix server — needed only to install and enable the plugin (see Install); vendor/bin/phpunit runs against the contracts alone, with no host process involved.

Running the tests locally

composer install
vendor/bin/phpunit
composer phpstan
composer phpcs
php scripts/security-audit-check.php   # same security gate CI runs

License

MIT — see LICENSE.