PHPackages                             detain/phlix-plugin-example - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. detain/phlix-plugin-example

ActivePhlix-plugin[Utility &amp; Helpers](/categories/utility)

detain/phlix-plugin-example
===========================

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

v0.1.0(3w ago)00MITPHPPHP &gt;=8.1CI passing

Since May 17Pushed 6d agoCompare

[ Source](https://github.com/detain/phlix-plugin-example)[ Packagist](https://packagist.org/packages/detain/phlix-plugin-example)[ Docs](https://github.com/detain/phlex-plugin-example)[ RSS](/packages/detain-phlix-plugin-example/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

phlix-plugin-example
====================

[](#phlix-plugin-example)

[![tests](https://github.com/detain/phlix-plugin-example/actions/workflows/test.yml/badge.svg)](https://github.com/detain/phlix-plugin-example/actions/workflows/test.yml)

> Reference **metadata-provider** plugin for [Phlix](https://github.com/detain/phlix)— the smallest plugin that exercises the full Phase A loader lifecycle.

This repo is the canonical hello-world template for Phlix plugin authors. It does almost nothing on purpose: it implements the `Phlix\Plugins\Contract\LifecycleInterface` contract introduced in Phlix Step A.4, returns a fixed greeting when asked about one well-known fixture path, and ships with a CI workflow plus PHPUnit tests so you can fork it as a starter and replace the lookup logic with the real one.

What it does
------------

[](#what-it-does)

When the host calls `HelloMetadataProvider::lookup('/test/hello.mkv')`the plugin returns:

```
['title' => 'Hello, World']
```

Any other path returns an empty array. The greeting is read from the `greeting` setting in `plugin.json` (default `"Hello, World"`) so operators can flip it without forking the code.

Install
-------

[](#install)

The plugin is unsigned by design — it's a reference implementation, not something the trusted-key allowlist should pin. Install via the Phlix admin UI:

1. Log in to your Phlix server as an admin user (`users.is_admin = 1`).
2. Browse to `/admin/plugins`.
3. Paste this URL into the **Install from URL** form and submit:

    ```
    https://raw.githubusercontent.com/detain/phlix-plugin-example/main/plugin.json

    ```
4. The server downloads the manifest, validates it against `docs/plugins/manifest.schema.json`, runs `composer install --no-dev`, 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; see [`docs/plugins/install-from-url.md`](https://github.com/detain/phlix/blob/master/docs/plugins/install-from-url.md)in the main Phlix repo for the `curl` recipes.

Use
---

[](#use)

Once enabled, ask the metadata layer to look up the fixture path. The exact API path depends on which Phlix version you're on, but the plugin's behaviour is fixed:

```
$provider = $container->get(\Phlix\PluginExample\HelloMetadataProvider::class);
$provider->lookup('/test/hello.mkv'); // ['title' => 'Hello, World']
$provider->lookup('/anything/else');  // []
```

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

Fork as a starter
-----------------

[](#fork-as-a-starter)

This repository is intentionally small (one PHP class, one test file) 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-`), bump `version` back to `0.1.0`, change `entry`to your FQCN, and (optionally) declare event aliases under `events` if you want to subscribe to playback / library / auth events. See the full schema in [`docs/plugins/manifest.schema.json`](https://github.com/detain/phlix/blob/master/docs/plugins/manifest.schema.json)in the main repo.
3. Edit **`composer.json`** — rename the package, change the PSR-4 prefix under `autoload.psr-4`.
4. Rewrite **`src/HelloMetadataProvider.php`** with your own implementation. Keep `onEnable()` cheap; do the heavy work in the listener methods declared by `subscribedEvents()`.
5. Replace the tests in **`tests/`** to match. The CI workflow in `.github/workflows/test.yml` runs them on every push.
6. Push to a public Git host. Tell operators to paste the raw URL of your `plugin.json` into `/admin/plugins`.

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

- [`docs/plugins/developer-guide.md`](https://github.com/detain/phlix/blob/master/docs/plugins/developer-guide.md)
- [`docs/plugins/manifest.md`](https://github.com/detain/phlix/blob/master/docs/plugins/manifest.md)
- [`docs/plugins/install-from-url.md`](https://github.com/detain/phlix/blob/master/docs/plugins/install-from-url.md)
- [`docs/plugins/trusted-plugin-list.md`](https://github.com/detain/phlix/blob/master/docs/plugins/trusted-plugin-list.md)

Running the tests locally
-------------------------

[](#running-the-tests-locally)

```
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

MIT — see [`LICENSE`](LICENSE).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance97

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

24d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1036e0717211b8030b83cbe729e8ba6ba442fdbd5285fb97a39d7dcfe339342?d=identicon)[detain](/maintainers/detain)

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (8 commits)")

---

Tags

composer-packageembyexamplejellyfinmedia-servermetadata-providerphlixphlix-pluginphpphp8plexexamplephlexphlex-pluginmetadata-provider

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/detain-phlix-plugin-example/health.svg)

```
[![Health](https://phpackages.com/badges/detain-phlix-plugin-example/health.svg)](https://phpackages.com/packages/detain-phlix-plugin-example)
```

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k447.1M8.9k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706127.7M12.4k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31080.7M2.3k](/packages/illuminate-container)[symfony/type-info

Extracts PHP types information.

20062.9M225](/packages/symfony-type-info)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k41](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

744284.3k34](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
