本文整理汇总了PHP中Zend\Cache\StorageFactory::setAdapterPluginManager方法的典型用法代码示例。如果您正苦于以下问题:PHP StorageFactory::setAdapterPluginManager方法的具体用法?PHP StorageFactory::setAdapterPluginManager怎么用?PHP StorageFactory::setAdapterPluginManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Cache\StorageFactory
的用法示例。
在下文中一共展示了StorageFactory::setAdapterPluginManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadStorage
/**
* Loads cache storage
*
* @param array|string $config
* 'adapter' - storage adapter; 'plugins'; 'options'
* @return AbstractAdapter
*/
public function loadStorage($config = array())
{
if (is_string($config)) {
$configFile = sprintf('cache.%s.php', $config);
$config = Pi::config()->load($configFile);
}
if (!isset($config['adapter']['options']['namespace'])) {
$config['adapter']['options']['namespace'] = '';
}
$config['adapter']['options']['namespace'] = $this->getNamespace($config['adapter']['options']['namespace']);
StorageFactory::setAdapterPluginManager(new AdapterPluginManager());
$storage = StorageFactory::factory($config);
return $storage;
}
示例2: testChangeAdapterPluginManager
public function testChangeAdapterPluginManager()
{
$adapters = new Cache\Storage\AdapterPluginManager();
Cache\StorageFactory::setAdapterPluginManager($adapters);
$this->assertSame($adapters, Cache\StorageFactory::getAdapterPluginManager());
}
示例3: prepareStorageFactory
/**
* Prepare the storage factory with the adapter and plugins plugin managers.
*
* @param ContainerInterface $container
* @return void
*/
private function prepareStorageFactory(ContainerInterface $container)
{
StorageFactory::setAdapterPluginManager($this->lookupStorageAdapterPluginManager($container));
StorageFactory::setPluginManager($this->lookupStoragePluginManager($container));
}