-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from beluga-core/develop-5
Develop 5
- Loading branch information
Showing
58 changed files
with
4,017 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
/** | ||
* Template for ZF2 module for storing local overrides. | ||
* | ||
* PHP version 5 | ||
* | ||
* Copyright (C) Villanova University 2010. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* @category VuFind2 | ||
* @package Module | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://github.com/dmj/vf2-proxy | ||
*/ | ||
namespace AutocompleteTerms; | ||
use Zend\ModuleManager\ModuleManager, | ||
Zend\Mvc\MvcEvent; | ||
|
||
/** | ||
* Template for ZF2 module for storing local overrides. | ||
* | ||
* @category VuFind2 | ||
* @package Module | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://github.com/dmj/vf2-proxy | ||
*/ | ||
class Module | ||
{ | ||
/** | ||
* Get module configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getConfig() | ||
{ | ||
return include __DIR__ . '/config/module.config.php'; | ||
} | ||
|
||
/** | ||
* Get autoloader configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getAutoloaderConfig() | ||
{ | ||
return array( | ||
'Zend\Loader\StandardAutoloader' => array( | ||
'namespaces' => array( | ||
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, | ||
), | ||
), | ||
); | ||
} | ||
|
||
/** | ||
* Initialize the module | ||
* | ||
* @param ModuleManager $m Module manager | ||
* | ||
* @return void | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function init(ModuleManager $m) | ||
{ | ||
} | ||
|
||
/** | ||
* Bootstrap the module | ||
* | ||
* @param MvcEvent $e Event | ||
* | ||
* @return void | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function onBootstrap(MvcEvent $e) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
namespace AutocompleteTerms\Module\Config; | ||
|
||
$config = [ | ||
'service_manager' => [ | ||
'allow_override' => true, | ||
'factories' => [ | ||
'AutocompleteTerms\Autocomplete\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', | ||
], | ||
'aliases' => [ | ||
'VuFind\AutocompletePluginManager' => 'AutocompleteTerms\Autocomplete\PluginManager', | ||
'VuFind\Autocomplete\PluginManager' => 'AutocompleteTerms\Autocomplete\PluginManager', | ||
], | ||
], | ||
]; | ||
|
||
return $config; |
48 changes: 48 additions & 0 deletions
48
module/AutocompleteTerms/src/AutocompleteTerms/Autocomplete/PluginFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Autocomplete handler plugin factory | ||
* | ||
* PHP version 7 | ||
* | ||
* Copyright (C) Villanova University 2010. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Autocomplete | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:autosuggesters Wiki | ||
*/ | ||
namespace AutocompleteTerms\Autocomplete; | ||
|
||
/** | ||
* Autocomplete handler plugin factory | ||
* | ||
* @category VuFind | ||
* @package Autocomplete | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:autosuggesters Wiki | ||
*/ | ||
class PluginFactory extends \VuFind\ServiceManager\AbstractPluginFactory | ||
{ | ||
/** | ||
* Constructor | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->defaultNamespace = 'AutocompleteTerms\Autocomplete'; | ||
} | ||
} |
114 changes: 114 additions & 0 deletions
114
module/AutocompleteTerms/src/AutocompleteTerms/Autocomplete/PluginManager.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
/** | ||
* Autocomplete handler plugin manager | ||
* | ||
* PHP version 7 | ||
* | ||
* Copyright (C) Villanova University 2010. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Autocomplete | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:autosuggesters Wiki | ||
*/ | ||
namespace AutocompleteTerms\Autocomplete; | ||
|
||
/** | ||
* Autocomplete handler plugin manager | ||
* | ||
* @category VuFind | ||
* @package Autocomplete | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:autosuggesters Wiki | ||
*/ | ||
class PluginManager extends \VuFind\Autocomplete\PluginManager | ||
{ | ||
/** | ||
* Default plugin aliases. | ||
* | ||
* @var array | ||
*/ | ||
protected $aliases = [ | ||
'none' => 'VuFind\Autocomplete\None', | ||
'eds' => 'VuFind\Autocomplete\Eds', | ||
'oclcidentities' => 'VuFind\Autocomplete\OCLCIdentities', | ||
'search2' => 'VuFind\Autocomplete\Search2', | ||
'search2cn' => 'VuFind\Autocomplete\Search2CN', | ||
'solr' => 'VuFind\Autocomplete\Solr', | ||
'solrauth' => 'VuFind\Autocomplete\SolrAuth', | ||
'solrcn' => 'VuFind\Autocomplete\SolrCN', | ||
'solrreserves' => 'VuFind\Autocomplete\SolrReserves', | ||
'tag' => 'VuFind\Autocomplete\Tag', | ||
// for legacy 1.x compatibility | ||
'noautocomplete' => 'None', | ||
'oclcidentitiesautocomplete' => 'OCLCIdentities', | ||
'solrautocomplete' => 'Solr', | ||
'solrauthautocomplete' => 'SolrAuth', | ||
'solrcnautocomplete' => 'SolrCN', | ||
'solrreservesautocomplete' => 'SolrReserves', | ||
'tagautocomplete' => 'Tag', | ||
'terms' => 'AutocompleteTerms\Autocomplete\Terms', | ||
]; | ||
|
||
/** | ||
* Default plugin factories. | ||
* | ||
* @var array | ||
*/ | ||
protected $factories = [ | ||
'VuFind\Autocomplete\None' => 'Zend\ServiceManager\Factory\InvokableFactory', | ||
'VuFind\Autocomplete\Eds' => 'VuFind\Autocomplete\EdsFactory', | ||
'VuFind\Autocomplete\OCLCIdentities' => | ||
'Zend\ServiceManager\Factory\InvokableFactory', | ||
'VuFind\Autocomplete\Search2' => 'VuFind\Autocomplete\SolrFactory', | ||
'VuFind\Autocomplete\Search2CN' => 'VuFind\Autocomplete\SolrFactory', | ||
'VuFind\Autocomplete\Solr' => 'VuFind\Autocomplete\SolrFactory', | ||
'VuFind\Autocomplete\SolrAuth' => 'VuFind\Autocomplete\SolrFactory', | ||
'VuFind\Autocomplete\SolrCN' => 'VuFind\Autocomplete\SolrFactory', | ||
'VuFind\Autocomplete\SolrReserves' => 'VuFind\Autocomplete\SolrFactory', | ||
'VuFind\Autocomplete\Tag' => 'Zend\ServiceManager\Factory\InvokableFactory', | ||
'AutocompleteTerms\Autocomplete\Terms' => 'AutocompleteTerms\Autocomplete\TermsFactory', | ||
]; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* Make sure plugins are properly initialized. | ||
* | ||
* @param mixed $configOrContainerInstance Configuration or container instance | ||
* @param array $v3config If $configOrContainerInstance is a | ||
* container, this value will be passed to the parent constructor. | ||
*/ | ||
public function __construct($configOrContainerInstance = null, | ||
array $v3config = [] | ||
) { | ||
$this->addAbstractFactory('AutocompleteTerms\Autocomplete\PluginFactory'); | ||
parent::__construct($configOrContainerInstance, $v3config); | ||
} | ||
|
||
/** | ||
* Return the name of the base class or interface that plug-ins must conform | ||
* to. | ||
* | ||
* @return string | ||
*/ | ||
protected function getExpectedInterface() | ||
{ | ||
return 'VuFind\Autocomplete\AutocompleteInterface'; | ||
} | ||
} |
Oops, something went wrong.