Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
PluginManager
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getExpectedInterface
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * Search options plugin manager
5 *
6 * PHP version 8
7 *
8 * Copyright (C) Villanova University 2010.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2,
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 *
23 * @category VuFind
24 * @package  Search
25 * @author   Demian Katz <demian.katz@villanova.edu>
26 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
27 * @link     https://vufind.org/wiki/development:plugins:record_drivers Wiki
28 */
29
30namespace VuFind\Search\Options;
31
32/**
33 * Search options plugin manager
34 *
35 * @category VuFind
36 * @package  Search
37 * @author   Demian Katz <demian.katz@villanova.edu>
38 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
39 * @link     https://vufind.org/wiki/development:plugins:record_drivers Wiki
40 */
41class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager
42{
43    /**
44     * Default plugin aliases.
45     *
46     * @var array
47     */
48    protected $aliases = [
49        'blender' => \VuFind\Search\Blender\Options::class,
50        'browzine' => \VuFind\Search\BrowZine\Options::class,
51        'combined' => \VuFind\Search\Combined\Options::class,
52        'eds' => \VuFind\Search\EDS\Options::class,
53        'eit' => \VuFind\Search\EIT\Options::class,
54        'epf' => \VuFind\Search\EPF\Options::class,
55        'emptyset' => \VuFind\Search\EmptySet\Options::class,
56        'favorites' => \VuFind\Search\Favorites\Options::class,
57        'libguides' => \VuFind\Search\LibGuides\Options::class,
58        'libguidesaz' => \VuFind\Search\LibGuidesAZ\Options::class,
59        'mixedlist' => \VuFind\Search\MixedList\Options::class,
60        'pazpar2' => \VuFind\Search\Pazpar2\Options::class,
61        'primo' => \VuFind\Search\Primo\Options::class,
62        'search2' => \VuFind\Search\Search2\Options::class,
63        'search2collection' => \VuFind\Search\Search2\Options::class,
64        'solr' => \VuFind\Search\Solr\Options::class,
65        'solrauth' => \VuFind\Search\SolrAuth\Options::class,
66        'solrauthor' => \VuFind\Search\SolrAuthor\Options::class,
67        'solrauthorfacets' => \VuFind\Search\SolrAuthorFacets\Options::class,
68        'solrcollection' => \VuFind\Search\SolrCollection\Options::class,
69        'solrreserves' => \VuFind\Search\SolrReserves\Options::class,
70        'solrweb' => \VuFind\Search\SolrWeb\Options::class,
71        'summon' => \VuFind\Search\Summon\Options::class,
72        'tags' => \VuFind\Search\Tags\Options::class,
73        'worldcat' => \VuFind\Search\WorldCat\Options::class,
74    ];
75
76    /**
77     * Default plugin factories.
78     *
79     * @var array
80     */
81    protected $factories = [
82        \VuFind\Search\Blender\Options::class => OptionsFactory::class,
83        \VuFind\Search\BrowZine\Options::class => OptionsFactory::class,
84        \VuFind\Search\Combined\Options::class => \VuFind\Search\Combined\OptionsFactory::class,
85        \VuFind\Search\EDS\Options::class =>
86            \VuFind\Search\EDS\OptionsFactory::class,
87        \VuFind\Search\EIT\Options::class => OptionsFactory::class,
88        \VuFind\Search\EPF\Options::class => OptionsFactory::class,
89        \VuFind\Search\EmptySet\Options::class => OptionsFactory::class,
90        \VuFind\Search\Favorites\Options::class => OptionsFactory::class,
91        \VuFind\Search\LibGuides\Options::class => OptionsFactory::class,
92        \VuFind\Search\LibGuidesAZ\Options::class => OptionsFactory::class,
93        \VuFind\Search\MixedList\Options::class => OptionsFactory::class,
94        \VuFind\Search\Pazpar2\Options::class => OptionsFactory::class,
95        \VuFind\Search\Primo\Options::class => OptionsFactory::class,
96        \VuFind\Search\Search2\Options::class => OptionsFactory::class,
97        \VuFind\Search\Search2Collection\Options::class => OptionsFactory::class,
98        \VuFind\Search\Solr\Options::class => OptionsFactory::class,
99        \VuFind\Search\SolrAuth\Options::class => OptionsFactory::class,
100        \VuFind\Search\SolrAuthor\Options::class => OptionsFactory::class,
101        \VuFind\Search\SolrAuthorFacets\Options::class => OptionsFactory::class,
102        \VuFind\Search\SolrCollection\Options::class => OptionsFactory::class,
103        \VuFind\Search\SolrReserves\Options::class => OptionsFactory::class,
104        \VuFind\Search\SolrWeb\Options::class => OptionsFactory::class,
105        \VuFind\Search\Summon\Options::class => OptionsFactory::class,
106        \VuFind\Search\Tags\Options::class => OptionsFactory::class,
107        \VuFind\Search\WorldCat\Options::class => OptionsFactory::class,
108    ];
109
110    /**
111     * Constructor
112     *
113     * Make sure plugins are properly initialized.
114     *
115     * @param mixed $configOrContainerInstance Configuration or container instance
116     * @param array $v3config                  If $configOrContainerInstance is a
117     * container, this value will be passed to the parent constructor.
118     */
119    public function __construct(
120        $configOrContainerInstance = null,
121        array $v3config = []
122    ) {
123        $this->addAbstractFactory(PluginFactory::class);
124        parent::__construct($configOrContainerInstance, $v3config);
125    }
126
127    /**
128     * Return the name of the base class or interface that plug-ins must conform
129     * to.
130     *
131     * @return string
132     */
133    protected function getExpectedInterface()
134    {
135        return \VuFind\Search\Base\Options::class;
136    }
137}