Skip to content
Snippets Groups Projects
Commit 212ee990 authored by Demian Katz's avatar Demian Katz
Browse files

Smarter initializer.

parent 9ca0fff8
Branches
Tags
No related merge requests found
......@@ -95,10 +95,12 @@ class Manager
// Set the service locator:
$index->setServiceLocator(self::$serviceLocator);
// Set the logger:
\VuFind\ServiceManager\Initializer::initInstance(
$index, self::$serviceLocator
);
// Inject dependencies with the standard initializer:
if (null !== self::$serviceLocator) {
\VuFind\ServiceManager\Initializer::initInstance(
$index, self::$serviceLocator
);
}
return $index;
}
......
......@@ -68,7 +68,10 @@ class Initializer
*/
public static function initPlugin($instance, AbstractPluginManager $manager)
{
static::initInstance($instance, $manager->getServiceLocator());
$sm = $manager->getServiceLocator();
if (null !== $sm) {
static::initInstance($instance, $sm);
}
if (method_exists($instance, 'setPluginManager')) {
$instance->setPluginManager($manager);
}
......
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