PluginManager
extends AbstractPluginManager
in package
Covers content loader plugin manager
Tags
Table of Contents
- $aliases : array<string|int, mixed>
- Default plugin aliases.
- $factories : array<string|int, mixed>
- Default plugin factories.
- __construct() : mixed
- Constructor
- get() : mixed
- Retrieve a plugin
- has() : bool
- Returns true if the container can return an entry for the given identifier.
- validate() : void
- Validate the plugin
- getExpectedInterface() : string
- Return the name of the base class or interface that plug-ins must conform to.
- getNormalizedServiceName() : string
- Hack for backward compatibility with services defined under ServiceManager v2, when service names were case-insensitive.
Properties
$aliases
Default plugin aliases.
protected
array<string|int, mixed>
$aliases
= [\VuFind\Content\Covers\Amazon::class => \VuFind\Content\Covers\Deprecated::class, 'amazon' => \VuFind\Content\Covers\Deprecated::class, 'bokinfo' => \VuFind\Content\Covers\Bokinfo::class, 'booksite' => \VuFind\Content\Covers\Booksite::class, 'buchhandel' => \VuFind\Content\Covers\Buchhandel::class, 'browzine' => \VuFind\Content\Covers\BrowZine::class, 'contentcafe' => \VuFind\Content\Covers\ContentCafe::class, 'google' => \VuFind\Content\Covers\Google::class, 'koha' => \VuFind\Content\Covers\Koha::class, 'librarything' => \VuFind\Content\Covers\LibraryThing::class, 'localfile' => \VuFind\Content\Covers\LocalFile::class, 'obalkyknih' => \VuFind\Content\Covers\ObalkyKnih::class, 'openlibrary' => \VuFind\Content\Covers\OpenLibrary::class, 'orb' => \VuFind\Content\Covers\Orb::class, 'summon' => \VuFind\Content\Covers\Summon::class, 'syndetics' => \VuFind\Content\Covers\Syndetics::class]
$factories
Default plugin factories.
protected
array<string|int, mixed>
$factories
= [\VuFind\Content\Covers\Amazon::class => \VuFind\Content\Covers\AmazonFactory::class, \VuFind\Content\Covers\Bokinfo::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, \VuFind\Content\Covers\Booksite::class => \VuFind\Content\Covers\BooksiteFactory::class, \VuFind\Content\Covers\BrowZine::class => \VuFind\Content\Covers\BrowZineFactory::class, \VuFind\Content\Covers\Buchhandel::class => \VuFind\Content\Covers\BuchhandelFactory::class, \VuFind\Content\Covers\ContentCafe::class => \VuFind\Content\Covers\ContentCafeFactory::class, \VuFind\Content\Covers\Deprecated::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, \VuFind\Content\Covers\Google::class => \VuFind\Content\Covers\GoogleFactory::class, \VuFind\Content\Covers\Koha::class => \VuFind\Content\Covers\KohaFactory::class, \VuFind\Content\Covers\LibraryThing::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, \VuFind\Content\Covers\LocalFile::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, \VuFind\Content\Covers\ObalkyKnih::class => \VuFind\Content\ObalkyKnihContentFactory::class, \VuFind\Content\Covers\OpenLibrary::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, \VuFind\Content\Covers\Orb::class => \VuFind\Content\Covers\OrbFactory::class, \VuFind\Content\Covers\Summon::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, \VuFind\Content\Covers\Syndetics::class => \VuFind\Content\Covers\SyndeticsFactory::class]
Methods
__construct()
Constructor
public
__construct([mixed $configOrContainerInstance = null ][, array<string|int, mixed> $v3config = [] ]) : mixed
Make sure plugins are properly initialized.
Parameters
- $configOrContainerInstance : mixed = null
-
Configuration or container instance
- $v3config : array<string|int, mixed> = []
-
If $configOrContainerInstance is a container, this value will be passed to the parent constructor.
Return values
mixed —get()
Retrieve a plugin
public
get(string $name[, null|array<string|int, mixed> $options = null ]) : mixed
Parameters
- $name : string
-
Name of plugin
- $options : null|array<string|int, mixed> = null
-
Options to use when creating the instance.
Return values
mixed —has()
Returns true if the container can return an entry for the given identifier.
public
has(string $id) : bool
Returns false otherwise.
Parameters
- $id : string
-
Identifier of the entry to look for.
Return values
bool —validate()
Validate the plugin
public
validate(mixed $plugin) : void
Checks that the filter loaded is either a valid callback or an instance of FilterInterface.
Parameters
- $plugin : mixed
-
Plugin to validate
Tags
Return values
void —getExpectedInterface()
Return the name of the base class or interface that plug-ins must conform to.
protected
getExpectedInterface() : string
Return values
string —getNormalizedServiceName()
Hack for backward compatibility with services defined under ServiceManager v2, when service names were case-insensitive.
protected
getNormalizedServiceName(string $name) : string
TODO: set up aliases and/or normalize code to eliminate the need for this.
Parameters
- $name : string
-
Service name