Download the PHP package detain/phlix-plugin-example without Composer

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

phlix-plugin-example

tests

Reference metadata-provider plugin for 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\Shared\Plugin\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

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

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

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:

  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 in the main Phlix repo for the curl recipes.

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:

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

Fork as a starter

This repository is intentionally small (one PHP class, one plugin 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 in the main repo.

    Note: If you declare a setting required:true, give it a default or the host will null-fill it — see docs/plugins/manifest.md.

  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:

Running the tests locally

License

MIT — see LICENSE.


All versions of phlix-plugin-example with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
detain/phlix-shared Version ^0.21.0
psr/container Version ^1.1 || ^2.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-plugin-example contains the following files

Loading the files please wait ...