detain/phlex-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 β the only bundled network code is the blocking CurlArrTransport (CLI/test only); event-loop consumers MUST inject an async ArrTransportInterface.
Maintainers
Requires
- php: ^8.3
- psr/container: ^2.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
Requires (Dev)
- ext-curl: *
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.10
- vimeo/psalm: ^5.0
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.
- 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
MIT c7627ab385f5d65a5f2f73058c860e213cd94a4e
This package is auto-updated.
Last update: 2026-06-28 17:26:15 UTC
README
π CI
π codecov
π PHP
π PHPStan
π Psalm
π Code style
π License: MIT
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 β pure interfaces and value objects only.
Status
v0.10.0 β adds the HTTP-over-relay protocol types (HTTP_REQUEST/HTTP_RESPONSE frames + request/response envelopes + chunk codec) so the hub can proxy a browser's HTTP request to a paired media server over the reverse tunnel. Cumulative surface:
Phlix\Shared\Plugin\{LifecycleInterface, Manifest, ManifestType, ManifestValidationError, EventNameMap}Phlix\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}β 12 event DTOs.Phlix\Shared\Auth\{JwtClaims, ProviderInterface, AuthResult, UserInfo}Phlix\Shared\Hub\{ClaimRequest, ClaimResponse, ServerInfoDto, HeartbeatDto}Phlix\Shared\Relay\{RelayFrameType, RelayWireCodecInterface, RelayFrame}β channel-mux protocol (0.5+); plus{RelayHttpRequest, RelayHttpResponseHead, RelayHttpResponseChunk, RelayHttpResponseCodec}β HTTP-over-relay request/response envelopes +HEADβBODY*βENDchunk framing (0.10.0+).Phlix\Shared\Arr\{BazarrClient, ProwlarrClient, RadarrClient, SonarrClient}β *arr HTTP clients.Phlix\Shared\Schema\SchemaPathsβ pure path resolver for the bundledschemas/files (0.7.0+).
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
Phlix\Shared\Schema\SchemaPaths):
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+).schemas/server-settings.schema.jsonβ JSON Schema (draft 2020-12) for the editable server settings (/api/v1/admin/settings); mirrors phlix-server'sAdminSettingsController::ALLOWED_KEYSallow-list and drives the admin SPA settings form (0.7.0+).schemas/webhook-events.jsonβ data catalog of the supported webhook event types for the admin SPA webhook picker. 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.
Requirements
- PHP
^8.3 - Composer 2.x
psr/container ^2.0psr/event-dispatcher ^1.0
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.
Installation
Until detain/phlix-shared is published to Packagist (planned post-v1.0),
consumers require it via a Composer VCS repository entry. Use the HTTPS URL
so CI runners without SSH keys can resolve it:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/detain/phlix-shared.git"
}
],
"require": {
"detain/phlix-shared": "^0.6"
}
}
Then:
composer update detain/phlix-shared
Related repositories
detain/phlix-serverβ the Phlix media server (consumes this package).detain/phlix-hubβ the multi-server hub + reverse-tunnel relay.
Development
composer install ./vendor/bin/phpunit ./vendor/bin/phpstan analyze --no-progress ./vendor/bin/phpcs --standard=PSR12 src/ ./vendor/bin/psalm --no-progress composer validate --strict composer audit --no-dev
License
MIT β see LICENSE.
