detain / phlix-shared
Shared interfaces, DTOs, event names, and protocol types used by both phlix-server and phlix-hub. Composer-installable, PHP 8.3+, zero I/O by charter — bundled I/O is confined to the Arr/ namespace: the blocking CurlArrTransport default (CLI/test posture) and TrashGuidesProvider's own blocking strea
Requires
- php: ^8.3
- psr/clock: ^1.0
- psr/container: ^2.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
Requires (Dev)
- ext-curl: *
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^12.5
- squizlabs/php_codesniffer: ^4.0
- vimeo/psalm: ^6.5
Suggests
- ext-curl: Required only for the bundled blocking Arr\Transport\CurlArrTransport (CLI/test use). Event-loop (Workerman/Webman) consumers should inject an async ArrTransportInterface instead and do not need ext-curl.
- ext-pdo: The Database\ transaction-mutex machine throws PDOException for catch-shape parity with the estate connections it was extracted from; the class itself performs no I/O, so the extension is only needed by consumers catching its refusals with the MySQL layer.
- workerman/http-client: Event-loop (Workerman/Webman) consumers should inject a workerman/http-client-backed Arr\Transport\ArrTransportInterface so *arr API calls do not block the worker; the bundled CurlArrTransport is blocking and for CLI/test only.
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v0.59.0
- v0.58.0
- v0.57.0
- v0.56.0
- v0.55.1
- v0.55.0
- v0.54.0
- v0.53.0
- v0.52.0
- v0.51.0
- v0.50.0
- v0.49.1
- v0.49.0
- v0.48.1
- v0.48.0
- v0.47.0
- v0.46.0
- v0.45.0
- v0.44.0
- v0.43.0
- v0.42.0
- v0.41.0
- v0.40.0
- v0.39.0
- v0.38.0
- v0.37.0
- v0.36.0
- v0.35.0
- v0.34.0
- v0.33.0
- v0.32.0
- v0.31.0
- v0.30.0
- v0.29.0
- v0.28.0
- v0.27.0
- v0.26.0
- v0.25.0
- v0.24.0
- v0.23.0
- v0.22.0
- 0.21.0
- 0.20.0
- v0.19.0
- v0.18.0
- v0.17.0
- v0.16.0
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.1
- v0.11.0
- v0.10.1
- v0.10.0
- v0.9.2
- v0.9.1
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- 0.6.0
- 0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2026-11-20 20:04:05 UTC
README
Shared interfaces, DTOs, event names, and protocol types used by both
detain/phlix-server (the media server)
and detain/phlix-hub (the multi-server hub).
Composer-installable, PHP 8.3+, zero I/O by charter — pure interfaces and
value objects, with one sanctioned exception: bundled I/O is confined to the
Arr\* namespace — the blocking cURL CurlArrTransport default of the *arr
HTTP clients, plus TrashGuidesProvider's own blocking stream fetches and its
optional config/trash_guides.php local read; see AGENTS.md (in the git checkout; it is excluded from the Composer archive).
Status
v0.59.0 (Phlix\Shared\Version::VERSION). At the working tip, schemas/server-settings.schema.json carries 87 keys (51 restart: true, 36 restart: false; a census of the working tree, not a v0.59.0 tag-time stamp); schemas/hub-settings.schema.json carries 18 keys in lockstep with phlix-hub's HubSettingsRepository::ALLOWED_KEYS. Cumulative surface:
-
Phlix\Shared\Plugin\{LifecycleInterface, ConfigurableInterface, Manifest, ManifestType, ManifestValidationError, EventNameMap} -
Phlix\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}— 12 event DTOs. -
Phlix\Shared\Auth\{JwtClaims, ProviderInterface, AuthResult, UserInfo, SessionFamily, FamilyRefusalReason, GrantConsume, FamilyGrace, PasswordHasher}—SessionFamilyis the claim/type/grace vocabulary (itsTYPE_*constants aliasJwtClaims);FamilyRefusalReason/GrantConsumeare the session-family rotation enums andFamilyGracethe pure within-grace arithmetic;PasswordHasheris the argon2id SSOT seam with the timing-burn dummy hash and burn-then-falseverify()built in (0.56.0+). -
Phlix\Shared\Metadata\MetadataSourceInterface— the typed contract a metadata-source plugin implements (sourceName(),supportedMediaTypes(),search(),getDetails(),getImages()) so the server'sSourceRegistrycan register/deregister it on plugin enable/disable without the oldmethod_exists/FQCN-sniffing convention (0.15.0+). -
Phlix\Shared\Subtitle\{SubtitleSourceInterface, SubtitleCandidate, SubtitleFile, Exception\QuotaExceeded}— the subtitle analogue ofMetadataSourceInterface:getName(),getPriority(), thesearchByPath()/searchByHash()/searchByImdbId()fan-out returningSubtitleCandidatevalues, and the quota-consumingdownload()that may throwQuotaExceeded(0.42.0+). -
Phlix\Shared\Hub\{ClaimRequest, ClaimResponse, ServerInfoDto, HeartbeatDto, LibraryRef} -
Phlix\Shared\Relay\{RelayFrameType, RelayWireCodecInterface, RelayFrame, FrameCodec, SyncPlayDialect}— channel-mux protocol (0.5+);FrameCodecis the canonical binary frame encoder (encode legs + hello/hello-ack JSON shapes; 0.56.0+);SyncPlayDialectis the canonicalsyncplay_*wire message-type catalog (shipped in v0.55.0); plusRelay\{RelayHttpRequest, RelayHttpRequestHead, RelayHttpRequestChunk, RelayHttpRequestCodec}andRelay\{RelayHttpResponseHead, RelayHttpResponseChunk, RelayHttpResponseCodec}— HTTP-over-relay request/response envelopes +HEAD→BODY*→ENDchunk framing (0.10.0+). -
Phlix\Shared\Arr\{ArrClientInterface, ArrClientFactory, AbstractArrClient, BazarrClient, ProwlarrClient, RadarrClient, SonarrClient, SyncResult, SecretRedactor, TrashGuidesProvider}— *arr HTTP clients with their factory, shared base, sync value object, redactor and TrashGuides provider;Arr\Transport\{ArrTransportInterface, CurlArrTransport}is the pluggable wire layer underneath. -
Phlix\Shared\Security\Hmac— the sharedcompute()/verify()seam for timing-safe HMAC-SHA256 in thesha256:<hex>colon-hex format, plus an additive envelope-separator arm (SEPARATOR_EQUALSserves the webhook legacysha256=<hex>shape; the colon default keeps every existing byte identical). Honest status: no production consumer imports it today — server webhooks sign with rawhash_hmac()and plugin-manifest checks are a trusted-digest allowlist, not a keyed HMAC — it is kept as the single-source keyed-signature primitive for a future consumer (there is nosign()method). -
Phlix\Shared\Security\{Base64Url, Pkce, Jwt, JwtTokenParts, JwtException, CredentialDigest, OriginPolicy, Ed25519Pem}— the estate security kernels cut from the server/hub duplicates (0.56.0+): strict/lax base64url codec; the hub S256-only PKCE guard set plus a verifier generator; an HS256 JWT mint/verify with thealg/typ-before-signature pin and frozen attack-vector corpus; the sha256 credential-digest seam (never for user passwords); the CSRF-origin brain kernel (pure forwarded/proto/localhost/same-site/verb/sec-fetch guards andcustodyMode, proven zero server/hub divergence); and Ed25519 PEM/JWK primitives with the kid fingerprint parameterized per emitting shape. Consumer delegation to these is the S1/S2 adoption waves. -
Phlix\Shared\Support\PayloadAssert— the presence/type assertion trait used by the wire DTOs that parse payloads through it:ClaimRequest,ClaimResponse,ServerInfoDto,HeartbeatDtoandJwtClaims.Hub\LibraryRefis the deliberate manual-validation exception (itsfromPayload()rejects empty strings inline);Auth\UserInfois a constructor value object that parses no payload at all. -
Phlix\Shared\Support\{EnvConfig, Json, Clock, Backoff}— the shared runtime helpers (0.56.0+): puregetenvreaders with the bool/opt-out word laws (no shell probes, no logging side-effects — charter-pinned deltas from the server original); the strict JSON seam (unconditional throw on encode, null-vs-rethrow discrimination on inbound decode); the monotonic-free epoch clocks with theunixMs()round law and a puremsFromUnixSeconds()fixture seam; and pure reconnect-mathstepped()/jittered()backoff with an injectable rng. -
Phlix\Shared\Database\{Uuid, WriteResult, UpsertSyntax, MysqlError, MigrationChecksum}— the estate database kernels cut from the server/hub twins (0.57.0+): the CSPRNG v4 mint with the publishedV4_PATTERNand therandomHex()entropy-law seam; the write-outcome predicate ('0'-means-success trap documented as law) with the hub's row-count fold; the portable upsert rewriter (ON DUPLICATE KEY UPDATEalias form rewritten toVALUES(col)on MariaDB/pre-8.0.19); the consolidated MySQL driver-code detector (named wire vocabulary, wire-authoritative-over-text parse); and the SV-4.9 migration-ledger checksum kernel — its committed 174-file corpus-equality fixture proves kernel ≡ both repos' normalizers (the consumer real-DB ledger rehearsal legs stay per-repo). -
Phlix\Shared\Database\{MysqlTxLockState, TxEnd, MysqlRetryPolicy, MysqlRetryVerdict, TxLease}— the transaction-mutex machine family (0.58.0+):MysqlTxLockStateis the Option-B ledger SSOT extracted from the server/hub TXMUTEX-A union (holder identity, nesting, the one-shot poison mark with cleared-on-reconnect, the cancel-checked acquire, and the clear-holder-before-pushhandOff()law) withTxEnd's total end-claim verdict;MysqlRetryPolicy/MysqlRetryVerdictare the statement-failure decision table (gone-in-transaction never replays and poisons; gone-in-autocommit replays exactly once; 1213 rolls back the whole transaction; 1205 keeps it usable); andTxLeasebinds one coroutine to the ledger — state, coroutine id, park seam and push seam bound once — carrying the single begin ceremony the server and hub landed identically, while the end ceremonies stay per-repo by design. The lock channel itself stays consumer-side; the family is pure state and decision, zero I/O. -
Phlix\Shared\Settings\SettingsCodec— the settings-column value codec (0.57.0+):decode()byte-identical to both repos' private ancestors;encode()ships the hub's strictJSON_THROW_ON_ERRORposture (the server silent variant is the disclosed divergence ending at S1 1.8 adoption); plus the pureeffective()decision arm and theclampValue()reader primitive. -
Phlix\Shared\RateLimit\{RateLimiterInterface, RateLimitState, RateLimiter, RateLimitException}— the auth-surface attempt-counter family (0.57.0+): bounded in-memory engine with expired-sweep-then-soonest-reset eviction and injectable clock; the hub-superset exception (MESSAGE_PREFIXwire copy, rounded-up minutesretryAfterMessage()); the hub-onlymultiWorkerNotice()copy-verbatim advisory (emission stays consumer glue).DbRateLimiter/RateLimitProfilesdeliberately stay per-repo. -
Phlix\Shared\Http\{ErrorEnvelope, ReasonPhrases, StaticPathPolicy, TrustedProxyResolver, WebSocketHandshake}— the HTTP kernel family (0.57.0+): the{error, code}-plus-additive body law with the 429/503 shape builders; the hub strict-empty reason law with a byte-faithful copy of the vendored WorkermanPHRASEStable (server migration to it is the named-'0'-bug fix); thephp/map/tplstatic-deny vocabulary in the hub's public predicate shape; the SV-4.15 trusted-proxy/XFF resolver; and theSec-WebSocket-Protocolstring kit (bearer offer/token/echo-line kernels — carrier policy intentionally stays per-repo). -
Phlix\Shared\Relay\LivenessWindows— the 3x liveness-margin law made executable (C-09/HB-0.1): a value object over ping-cadence/reap-window pairs whoseassertMargin()refuses mis-coupled tunings at boot instead of reaping ghosts. -
Phlix\Shared\Updates\{CoreUpdateStatus, VersionMarkerFetcherInterface},Phlix\Shared\Metrics\MetricsRepositoryInterface,Phlix\Shared\Runtime\HookDeliveryException,Phlix\Shared\Console\JsonEnvelope— the exact-twin lifts (0.57.0+): the updates-marker pair (S74/S75; camelCase admin-parser key order, fork-free marker fetch contract); the metrics read-side interface (S1/S4; window defaults pinned); the hook-delivery failure marker (S433: both failure shapes loud, an inconclusive check is never a pass); and the CLI--jsonenvelope string kernels (key order, list normalization, throw-on-error; the Symfony-bound trait glue andJSON_OUTPUT_MARKERstay per-repo). -
Phlix\Shared\Hub\HostGrammar— promoted from an internal detail to a public stable surface at 0.57.0 (M-34): its host/URL shape law is now contractually consumer-facing and reshaping it is a major-bump event; the promotion status is pinned by a reflection suite that reddens if the old@internalmarker returns. -
Phlix\Shared\Schema\SchemaPaths— pure path resolver for the bundledschemas/files (0.7.0+). -
Phlix\Shared\Version— the singleVERSIONconstant consumers pin and report.
Bundled schemas
The package ships the canonical JSON files used by both phlix-server and the
admin SPA under schemas/ (resolve their absolute paths via the dedicated
Phlix\Shared\Schema\SchemaPaths accessors — serverSettings(), hubSettings(),
webhookEvents(), mediaItem(), libraryQuery() — and via SchemaPaths::dir()
for the files without a dedicated accessor, such as manifest.schema.json):
-
schemas/manifest.schema.json— JSON Schema (draft 2020-12) for plugin manifests, loaded at runtime byphlix-server'sPhlix\Plugins\Manifest\ManifestSchemavalidator (0.6.0+). Per-settinglabelanddescriptionare permitted, andinteger/booleanare accepted as aliases ofint/boolin the settingtypeenum (0.9.1+). An optional per-settingtier(standard|advanced) is accepted on plugin settings fields so aplugin.jsondeclaring it passes install-time manifest validation (0.43.0+). -
schemas/hub-settings.schema.json— JSON Schema (draft 2020-12) for the editable hub settings (/api/v1/me/hub-settings), resolved viaSchemaPaths::hubSettings()(0.22.0+). Its property keys must stay in lockstep withphlix-hub'sHubSettingsRepository::ALLOWED_KEYS— that constant is what the hub settings controller enumerates, and the schema supplies only the render metadata for those keys (0.24.0+). The lockstep is guarded from this side bytests/Schema/HubSettingsSchemaTest.php, whose drift test parses the LIVE constant out of a hub checkout — found via thePHLIX_HUB_REPOenv pointer (a broken pointer fails the run; it never silently skips) or aphlix-hubsibling directory of this checkout — and skips only when no hub checkout exists at all (shared CI takes that skip; the test's frozen mirror and the hub's own reverse guard cover the keys there). -
schemas/server-settings.schema.json— JSON Schema (draft 2020-12) for the editable server settings (/api/v1/admin/settings); phlix-server derives its writable allow-list from this schema and the admin SPA renders the settings form from it (0.7.0+). Extended with optional UI-metadata keywords (label,helpText,helpLinks,tier,enumLabels,optionHelp,secret,restart) so the admin settings UI can render per-option help text and split Standard vs Advanced options (0.22.0+). Their normative semantics — requiredness, shape, and the verified consumer effect of each keyword — are specified in-repo by the keyword-semantics table at the top oftests/Schema/SettingsSchemaAssertions.php, whose assertions are that table's executable enforcement; no external plan document is needed to author or review a key.Key-naming contract (0.25.0+). Every property key must be a dotted path that
Phlix\Admin\SettingsRepository::getDefault()can resolve: a LEADING RUN of segments names a config file under the consuming repo'sconfig/, and the remaining segments index into that file's returned array. The file part may span subdirectories — the longest matching file path wins, soscrobblers.trakt.client_idresolvesconfig/scrobblers/trakt.phpin preference to a same-named flat file. Every file segment is jailed to/^[A-Za-z0-9_-]+$/, so no key can escapeconfig/. A key that does not resolve renders an empty control and can never take effect, so no such key may be declared. Thetrakt.*keys deliberately use a FLAT prefix backed byphlix-server'sconfig/trakt.phpre-export shim rather than the nestedscrobblers.trakt.*form:trakt.*overrides are already persisted in liveserver_settingstables andTraktOperatorConfig::SETTING_KEY_MAPreads those exact keys, so renaming them would orphan real rows (0.25.0+). Addsmatching.noise_suffixes(array of strings; the admin-extensible match-title noise list — 0.13.0+) andmetadata.provider_priority(object: media type → ordered array of source names; defaultsmovie/series=["tmdb","imdb"],anime=["anidb","myanimelist","tvdb","fanart","local"])metadata.genres_mode(enumfirst|union, defaultfirst) for the per-media-type metadata source-priority editor (0.14.0+). Addsmetadata.overwrite_existing(boolean,group: metadata,tier: standard, 0.41.0+),subtitles.provider_priority(a single flat ordered array of subtitle-source names, default["opensubtitles"], read bySubtitleFetchService/SubtitleSourceRegistry::byPriority()— 0.44.0+), anddlna.allowed_cidrs(array, default[]) +dlna.restrict_to_lan(boolean, defaulttrue), bothtier: advanced/group: subsystem, read live byDlnaAllowlistMiddlewareto gate the unauthenticated DLNA browse/stream endpoints (0.45.0+). Addstranscoding.segment_format(enummpegts|fmp4,group: transcoding,tier: advanced,restart: false), which is what makes the segment container settable over the admin API — theenummirrors phlix-server'sEncodeSettings::SEGMENT_FORMATSand is read byEncodeSettings::segmentFormat()at encode time (0.49.0+); itsdefault,enumLabels,optionHelp,helpText, anddescriptionnow describefmp4as the shipped container andmpegtsas the supported rollback (0.49.1+).
restartflags (0.46.0–0.48.0 audit). Every one of the then-72 keys was traced to its consumer (the audit window held 72 — v0.46.0 = v0.47.0 = v0.48.0 = v0.48.1; the 73rd,transcoding.segment_format, arrived with the 0.49.0 addition named just above); keys added since each carry an explicit flag too. As of 0.53.0 the schema held 84 keys (51 true / 33 false); the cookie-program trio (auth.cookie.enabled,auth.cookie.insecure,auth.ws_query_token— all live reads, Unreleased) brings it to 87 keys: 51 carryrestart: trueand 36 carryrestart: false.restart: truemeans the admin Restart server control (a graceful SIGUSR2 reload that cycles workers, re-runsonWorkerStart, and rebuilds DI containers) — required for any value captured at worker start, container build, or route build. Therestart: falsekeys resolve throughSettingsRepository::getEffective()at use time and are genuinely live. -
schemas/webhook-events.json— data catalog of the wire-truth webhook event types for the admin SPA webhook picker. Note: this file is currently a subset — the server'sPhlix\Webhooks\WebhookEventCatalogand thephlix-uipicker deliberately lead it today (theuser.*events the server already emits are not yet named here; widening this catalog is owed in this package). Distinct from the plugin PSR-14 events inEventNameMap(0.7.0+). -
schemas/library-query.schema.json— JSON Schema (draft 2020-12) for the query parameters of the movie-list browse API (GET /api/v1/media); drivesItemRepository::query()and the admin SPA browse page (0.8.0+). Adds thelibraryId/parentId/topLevelscoping parameters for series→season→episode navigation (0.9.0+). -
schemas/media-item.schema.json— JSON Schema (draft 2020-12) for a single media item returned by the browse API; flattensmetadata_jsoninto stable top-level fields and always includesposter_url(0.8.0+). Thetypeenum gainsseasonalongsideparent_id,season_number,episode_number, andepisode_titlefor the series hierarchy (0.9.0+).
The PSR-14 dispatcher wiring (Tukio) and the schema validators stay in
phlix-server and consume this package via Composer.
Adding a server settings key (runbook)
The schemas are this repo's whole job; touching one means touching its test
locks in the same commit. tests/Schema/ServerSettingsSchemaTest.php holds
three locks, and every one of them fails loudly with guidance text —
this runbook is those steps written down before you hit them:
- Schema JSON. Add the property to
schemas/server-settings.schema.json. The key must be a dotted path resolvable by the server'sSettingsRepository::getDefault()(leading run = aconfig/file, longest file path wins, every file segment jailed to/^[A-Za-z0-9_-]+$/— see the Key-naming contract above). Give itlabel,helpText,group,tier, and an explicitrestart(true/false— the unset count is pinned at 0); mark credentialssecret: true. - Roster lock. Add the key's row to
ServerSettingsSchemaTest::propertyProvider()('key' => ['key', '<json-type>']) and bump theassertCount(N, $actual)intest_schema_has_exactly_the_expected_property_keys— the roster test asserts the schema declares exactly the documented keys, set-equality plus count. - Pin lock. Add the key's full-value row to
ServerSettingsSchemaTest::pinTable(): type / default / bounds / enum / restart / secret, each verified to reproduce deployed behavior before it ships (theschemaPinProvider()data-provider test checks the schema against this table, andtest_pin_table_covers_exactly_the_schema_propertiesset-equality refuses a schema key without a pin row — its throw message is the deliberate "add the rows deliberately" guidance). - Naming/keyword laws. The remaining pins (first-segment config-file name, forbidden key namespaces, secret-credential list, label/help presence, enum-option documentation, numeric bounds presence) run per key and per header; read their failure messages, do not widen them.
- Consumer rule. Keys are deleted through
CONSUMERLESS_KEY_DENYLIST(deletion record; a deny-listed key must not be re-added). A new key must therefore have a real consumer inphlix-serverreading the effective value — adding schema surface nothing reads is how key-count theater starts. - Hub keys differ. For
schemas/hub-settings.schema.json, the property keys must stay set-equal withphlix-hub'sHubSettingsRepository::ALLOWED_KEYS(see Bundled schemas above); the two-sided drift guard istests/Schema/HubSettingsSchemaTest.php(live via a hub checkout or thePHLIX_HUB_REPOpointer; CI runs the frozen mirror leg). - Verify + release.
./vendor/bin/phpunit,phpstan analyze, both phpcs legs,./vendor/bin/psalm --no-progress,composer validate --strictandphp scripts/security-audit-check.php— all green in the same commit. This runbook lists the schema-relevant gates; the complete eight-command list is in AGENTS.md "Before committing". Release is lockstep:Version::VERSION= CHANGELOG heading = annotated git tag (AGENTS.md "Versioning"); consumers then bump their^0.xpin.
Requirements
- PHP
^8.3— CI-verified on PHP 8.3 and 8.4 (phpcs, phpstan, psalm and phpunit each run both legs; PHP 8.5 is not in the matrix because the toolchain's locked vimeo/psalm 6.x declares a~8.4.0ceiling); declared compatible below PHP 9.0. - Composer 2.x
psr/clock ^1.0psr/container ^2.0psr/event-dispatcher ^1.0psr/log ^3.0- Contributors only (
require-dev):ext-curl— the test suite exercisesCurlArrTransport.
psr/event-dispatcher is deliberately declarative: no class in src/
imports a PSR-14 interface — dispatching the plain event DTOs under
Phlix\Shared\Events\ is structurally valid PSR-14 usage — and the
require is kept as a consumer-convenience typing declaration so packages
wiring a dispatcher resolve the contract through this package's own
dependency set (keep-by-decision, not oversight; see
Phlix\Shared\Events\AbstractEvent).
The package has zero framework dependencies — no Workerman, no Monolog,
no Smarty. It is intended to be safely required by any PHP 8.3+ codebase,
with one caveat: the Arr\* HTTP clients are real network code (their
default transport needs ext-curl, or inject an ArrTransportInterface;
see AGENTS.md in the git checkout).
Installation
detain/phlix-shared is published on Packagist:
composer require detain/phlix-shared:^0.59
Package layout
The split is charter-driven: each top-level namespace under src/ is
exactly the contract one consumer surface needs, and nothing more.
Auth/, Hub/ and Relay/ mirror the server↔hub wire (token and claim
types, protocol DTOs, tunnel and HTTP-over-relay envelopes); Plugin/ and
Events/ are the plugin-facing surface (lifecycle, manifest, PSR-14 event
DTOs and the alias map); Metadata/ and Subtitle/ hold the two plugin
source contracts the server's registries consume; Arr/ is the sole
sanctioned I/O exception (*arr clients behind a pluggable transport seam);
Schema/, Security/ and Support/ are shared helpers (schema-path
resolution, the HMAC seam, wire-DTO assertions); Version.php is the
single version marker consumers pin. A new helper belongs in the namespace
of the contract it serves — if it serves none of them, it likely belongs in
the consumer's own repo. (The longer contributor-facing version, including
the layout tree, lives in AGENTS.md in the git checkout; the
historical WHAT-MOVES-WHERE table in plans/expansion/b.1-shared-design.md
of detain/phlix is history-only and not
part of the estate checkouts.)
Related repositories
detain/phlix-server— the Phlix media server (consumes this package).detain/phlix-hub— the multi-server hub + reverse-tunnel relay.- Usage guides — the developer pages under
detain/phlix-docs(e.g.shared-schemas.md,arr-clients.md,relay-protocol.md).
Development
composer install ./vendor/bin/phpunit ./vendor/bin/phpstan analyze --no-progress ./vendor/bin/phpcs --standard=PSR12 src/ ./vendor/bin/phpcs --standard=phpcs-tests.xml ./vendor/bin/psalm --no-progress composer validate --strict php scripts/security-audit-check.php
CI enforces every line above, including the tests/ phpcs gate. The
composer scripts test, stan, cs, cs-tests and psalm alias the
vendor-binary lines.
⚠ The last step replaces composer audit --no-dev. Never audit with a
development-dependency exclusion: --no-dev drops every require-dev package
from the audited set, and it hid CVE-2026-67434 (HIGH, OS command injection) in
squizlabs/php_codesniffer — a require-dev package — so CI reported SUCCESS
against a vulnerable lock. scripts/security-audit-check.php audits the whole
lock, labels each finding [require] / [require-dev], and prints the number of
packages it examined so a truncated audit cannot pass as a clean one. See
AGENTS.md (in the git checkout) for the full policy.
The phpunit job in .github/workflows/ci.yml uploads
./coverage.xml to both Codecov and Codacy.
License
MIT — see LICENSE.