Skip to content
Snippets Groups Projects
Commit d8daf3bf authored by crhallberg's avatar crhallberg
Browse files

Fixed to the new module config format.

parent 4a0951f5
No related merge requests found
...@@ -9,23 +9,10 @@ $config = array( ...@@ -9,23 +9,10 @@ $config = array(
), ),
'service_manager' => array( 'service_manager' => array(
'factories' => array( 'factories' => array(
'VuDL\Connection\Manager' => function ($sm) { 'VuDL\Connection\Manager' => array('VuDL\Factory', 'getConnectionManager'),
return new \VuDL\Connection\Manager( 'VuDL\Connection\Fedora' => array('VuDL\Factory', 'getConnectionFedora'),
array('Solr', 'Fedora'), $sm 'VuDL\Connection\Solr' => array('VuDL\Factory', 'getConnectionSolr'),
); ),
},
'VuDL\Connection\Fedora' => function ($sm) {
return new \VuDL\Connection\Fedora(
$sm->get('VuFind\Config')->get('VuDL')
);
},
'VuDL\Connection\Solr' => function ($sm) {
return new \VuDL\Connection\Solr(
$sm->get('VuFind\Config')->get('VuDL'),
$sm->get('VuFind\Search\BackendManager')->get('Solr')
);
}
)
), ),
'vufind' => array( 'vufind' => array(
'plugin_managers' => array( 'plugin_managers' => array(
......
...@@ -40,15 +40,46 @@ use Zend\ServiceManager\ServiceManager; ...@@ -40,15 +40,46 @@ use Zend\ServiceManager\ServiceManager;
class Factory class Factory
{ {
/** /**
* Construct the Fedora service. * Construct the Connection Manager service.
* *
* @param ServiceManager $sm Service manager. * @param ServiceManager $sm Service manager.
* *
* @return Fedora * @return Fedora
*/ */
public static function getFedora(ServiceManager $sm) public static function getConnectionManager(ServiceManager $sm)
{ {
return new \VuDL\Fedora($sm->get('VuFind\Config')->get('VuDL')); return new \VuDL\Connection\Manager(
array('Solr', 'Fedora'), $sm
);
}
/**
* Construct the Connection Fedora service.
*
* @param ServiceManager $sm Service manager.
*
* @return Fedora
*/
public static function getConnectionFedora(ServiceManager $sm)
{
return new \VuDL\Connection\Fedora(
$sm->get('VuFind\Config')->get('VuDL')
);
}
/**
* Construct the Connection Solr service.
*
* @param ServiceManager $sm Service manager.
*
* @return Fedora
*/
public static function getConnectionSolr(ServiceManager $sm)
{
return new \VuDL\Connection\Solr(
$sm->get('VuFind\Config')->get('VuDL'),
$sm->get('VuFind\Search\BackendManager')->get('Solr')
);
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment