{"id":51118878,"url":"https://github.com/detain/phlix-plugin-example","last_synced_at":"2026-06-25T00:30:25.505Z","repository":{"id":359781669,"uuid":"1241165666","full_name":"detain/phlix-plugin-example","owner":"detain","description":"Hello-world metadata-provider plugin for Phlix — reference implementation","archived":false,"fork":false,"pushed_at":"2026-06-03T09:03:54.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-03T11:06:01.413Z","etag":null,"topics":["composer-package","emby","example","jellyfin","media-server","metadata-provider","phlix","phlix-plugin","php","php8","plex"],"latest_commit_sha":null,"homepage":"https://phlex.media","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/detain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-17T03:20:16.000Z","updated_at":"2026-06-03T09:03:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/detain/phlix-plugin-example","commit_stats":null,"previous_names":["detain/phlix-plugin-example"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/detain/phlix-plugin-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fphlix-plugin-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fphlix-plugin-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fphlix-plugin-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fphlix-plugin-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/detain","download_url":"https://codeload.github.com/detain/phlix-plugin-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detain%2Fphlix-plugin-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34755061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer-package","emby","example","jellyfin","media-server","metadata-provider","phlix","phlix-plugin","php","php8","plex"],"created_at":"2026-06-25T00:30:24.746Z","updated_at":"2026-06-25T00:30:25.500Z","avatar_url":"https://github.com/detain.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phlix-plugin-example\n\n[![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)\n\n\u003e Reference **metadata-provider** plugin for [Phlix](https://github.com/detain/phlix)\n\u003e — the smallest plugin that exercises the full Phase A loader lifecycle.\n\nThis repo is the canonical hello-world template for Phlix plugin\nauthors. It does almost nothing on purpose: it implements the\n`Phlix\\Plugins\\Contract\\LifecycleInterface` contract introduced in\nPhlix Step A.4, returns a fixed greeting when asked about one\nwell-known fixture path, and ships with a CI workflow plus PHPUnit\ntests so you can fork it as a starter and replace the lookup logic\nwith the real one.\n\n## What it does\n\nWhen the host calls `HelloMetadataProvider::lookup('/test/hello.mkv')`\nthe plugin returns:\n\n```php\n['title' =\u003e 'Hello, World']\n```\n\nAny other path returns an empty array. The greeting is read from the\n`greeting` setting in `plugin.json` (default `\"Hello, World\"`) so\noperators can flip it without forking the code.\n\n## Install\n\nThe plugin is unsigned by design — it's a reference implementation,\nnot something the trusted-key allowlist should pin. Install via the\nPhlix admin UI:\n\n1. Log in to your Phlix server as an admin user\n   (`users.is_admin = 1`).\n2. Browse to `/admin/plugins`.\n3. Paste this URL into the **Install from URL** form and submit:\n\n   ```\n   https://raw.githubusercontent.com/detain/phlix-plugin-example/main/plugin.json\n   ```\n\n4. The server downloads the manifest, validates it against\n   `docs/plugins/manifest.schema.json`, runs\n   `composer install --no-dev`, and stores a row in the `plugins`\n   table. The plugin lands **disabled** by default.\n5. Flip the toggle in the table to enable it.\n\nThe same operations are reachable via the JSON API; see\n[`docs/plugins/install-from-url.md`](https://github.com/detain/phlix/blob/master/docs/plugins/install-from-url.md)\nin the main Phlix repo for the `curl` recipes.\n\n## Use\n\nOnce enabled, ask the metadata layer to look up the fixture path. The\nexact API path depends on which Phlix version you're on, but the\nplugin's behaviour is fixed:\n\n```php\n$provider = $container-\u003eget(\\Phlix\\PluginExample\\HelloMetadataProvider::class);\n$provider-\u003elookup('/test/hello.mkv'); // ['title' =\u003e 'Hello, World']\n$provider-\u003elookup('/anything/else');  // []\n```\n\nThe fixture path lives at\n`Phlix\\PluginExample\\HelloMetadataProvider::FIXTURE_PATH` if you want\nto reference it from tests.\n\n## Fork as a starter\n\nThis repository is intentionally small (one PHP class, one test\nfile) so you can copy it as the seed for your own plugin:\n\n1. **Fork** or `git clone` this repo, then rename the new directory.\n2. Edit **`plugin.json`** — pick a new `name` (must start with\n   `phlix-plugin-`), bump `version` back to `0.1.0`, change `entry`\n   to your FQCN, and (optionally) declare event aliases under\n   `events` if you want to subscribe to playback / library / auth\n   events. See the full schema in\n   [`docs/plugins/manifest.schema.json`](https://github.com/detain/phlix/blob/master/docs/plugins/manifest.schema.json)\n   in the main repo.\n3. Edit **`composer.json`** — rename the package, change the PSR-4\n   prefix under `autoload.psr-4`.\n4. Rewrite **`src/HelloMetadataProvider.php`** with your own\n   implementation. Keep `onEnable()` cheap; do the heavy work in the\n   listener methods declared by `subscribedEvents()`.\n5. Replace the tests in **`tests/`** to match. The CI workflow in\n   `.github/workflows/test.yml` runs them on every push.\n6. Push to a public Git host. Tell operators to paste the raw URL of\n   your `plugin.json` into `/admin/plugins`.\n\nThe plugin developer guide in the main Phlix repo has the full\nwalkthrough, including the lifecycle diagram and the manifest event\nalias table:\n\n- [`docs/plugins/developer-guide.md`](https://github.com/detain/phlix/blob/master/docs/plugins/developer-guide.md)\n- [`docs/plugins/manifest.md`](https://github.com/detain/phlix/blob/master/docs/plugins/manifest.md)\n- [`docs/plugins/install-from-url.md`](https://github.com/detain/phlix/blob/master/docs/plugins/install-from-url.md)\n- [`docs/plugins/trusted-plugin-list.md`](https://github.com/detain/phlix/blob/master/docs/plugins/trusted-plugin-list.md)\n\n## Running the tests locally\n\n```bash\ncomposer install\nvendor/bin/phpunit\n```\n\n## License\n\nMIT — see [`LICENSE`](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetain%2Fphlix-plugin-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdetain%2Fphlix-plugin-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetain%2Fphlix-plugin-example/lists"}