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

Improved proxy manager configuration.

parent cbe2a872
No related merge requests found
......@@ -160,6 +160,7 @@ $config = [
'VuFind\ILSTitleHoldLogic' => 'VuFind\Service\Factory::getILSTitleHoldLogic',
'VuFind\Logger' => 'VuFind\Service\Factory::getLogger',
'VuFind\Mailer' => 'VuFind\Mailer\Factory',
'VuFind\ProxyConfig' => 'VuFind\Service\Factory::getProxyConfig',
'VuFind\Recaptcha' => 'VuFind\Service\Factory::getRecaptcha',
'VuFind\RecommendPluginManager' => 'VuFind\Service\Factory::getRecommendPluginManager',
'VuFind\RecordDriverPluginManager' => 'VuFind\Service\Factory::getRecordDriverPluginManager',
......
......@@ -79,7 +79,8 @@ class Factory
// Indicate that initialization is complete to avoid reinitialization:
$proxy->setProxyInitializer(null);
};
$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory();
$cfg = $sm->get('VuFind\ProxyConfig');
$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($cfg);
return $factory->createProxy('VuFind\Auth\ILSAuthenticator', $callback);
}
......
......@@ -461,6 +461,25 @@ class Factory
return $logger;
}
/**
* Construct the ProxyManager configuration.
*
* @param ServiceManager $sm Service manager.
*
* @return \ProxyManager\Configuration
*/
public static function getProxyConfig(ServiceManager $sm)
{
$config = new \ProxyManager\Configuration();
$cacheManager = $sm->get('VuFind\CacheManager');
$dir = $cacheManager->getCacheDir() . 'objects';
$config->setProxiesTargetDir($dir);
if (APPLICATION_ENV != 'development') {
spl_autoload_register($config->getProxyAutoloader());
}
return $config;
}
/**
* Construct the recaptcha helper
*
......
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