Download the PHP package detain/phlix-shared without Composer

On this page you can find all versions of the php package detain/phlix-shared. 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 phlix-shared

detain/phlix-shared

CI codecov PHP PHPStan Psalm Code style

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.55.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.55.0 tag-time stamp); schemas/hub-settings.schema.json carries 18 keys in lockstep with phlix-hub's HubSettingsRepository::ALLOWED_KEYS. Cumulative surface:

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):

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:

  1. Schema JSON. Add the property to schemas/server-settings.schema.json. The key must be a dotted path resolvable by the server's SettingsRepository::getDefault() (leading run = a config/ file, longest file path wins, every file segment jailed to /^[A-Za-z0-9_-]+$/ — see the Key-naming contract above). Give it label, helpText, group, tier, and an explicit restart (true/false — the unset count is pinned at 0); mark credentials secret: true.
  2. Roster lock. Add the key's row to ServerSettingsSchemaTest::propertyProvider() ('key' => ['key', '<json-type>']) and bump the assertCount(N, $actual) in test_schema_has_exactly_the_expected_property_keys — the roster test asserts the schema declares exactly the documented keys, set-equality plus count.
  3. 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 (the schemaPinProvider() data-provider test checks the schema against this table, and test_pin_table_covers_exactly_the_schema_properties set-equality refuses a schema key without a pin row — its throw message is the deliberate "add the rows deliberately" guidance).
  4. 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.
  5. 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 in phlix-server reading the effective value — adding schema surface nothing reads is how key-count theater starts.
  6. Hub keys differ. For schemas/hub-settings.schema.json, the property keys must stay set-equal with phlix-hub's HubSettingsRepository::ALLOWED_KEYS (see Bundled schemas above); the two-sided drift guard is tests/Schema/HubSettingsSchemaTest.php (live via a hub checkout or the PHLIX_HUB_REPO pointer; CI runs the frozen mirror leg).
  7. Verify + release. ./vendor/bin/phpunit, phpstan analyze, both phpcs legs, ./vendor/bin/psalm --no-progress, composer validate --strict and php 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.x pin.

Requirements

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:

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

Development

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.


All versions of phlix-shared with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
psr/clock Version ^1.0
psr/container Version ^2.0
psr/event-dispatcher Version ^1.0
psr/log Version ^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 detain/phlix-shared contains the following files

Loading the files please wait ...