Plugins
Extend Phlix with a versioned plugin contract. Drop in, Phlix picks it up.
How it works
Phlix uses a LifecycleInterface + manifest schema for plugins. Every plugin ships a manifest.json that declares its version, dependencies, and lifecycle hooks. Phlix's plugin loader validates and runs plugins without requiring restarts.
{
"name": "my-metadata-plugin",
"version": "1.0.0",
"manifest_version": "1.0",
"lifecycle": ["metadata_provider"],
"dependencies": {
"phlix/core": ">=5.0.0"
}
}
Plugin Types
Metadata Providers
Fetch movie/TV metadata from TMDB, TVDB, Fanart.tv, or any source you prefer. Phlix includes built-in providers for common sources, but you can replace or extend them.
Transcoding Filters
Add custom FFmpeg filters, quality profiles, or hardware acceleration backends. Hook into the transcode pipeline to optimize for your specific hardware.
Authentication Providers
Integrate with LDAP, OAuth, SAML, or any auth system. Replace or augment Phlix's built-in JWT auth with your organization's identity provider.
Storage Backends
Use S3, B2, or other object storage as your media library backend. Phlix's storage abstraction lets you mix local storage with cloud backends.
Example Plugin
<?php
// phlix-plugin-example/src/MetadataProvider.php
declare(strict_types=1);
namespace Example\Metadata;
use Detain\Phlix\Plugin\LifecycleInterface;
use Detain\Phlix\Plugin\Manifest;
final class MetadataProvider implements LifecycleInterface
{
public static function getManifest(): Manifest
{
return new Manifest(
name: 'example/metadata',
version: '1.0.0',
manifestVersion: '1.0',
lifecycle: ['metadata_provider']
);
}
public function fetchMetadata(string $imdbId): array
{
// Fetch from your metadata source
return ['title' => 'Example', 'year' => 2024];
}
}