Yes. I'm reading the zf2 code.
I found that 'adapter' can be array or string and $cfg also can has
'options' key.
$adapterName = $cfg['adapter'];
$adapterOptions = null;
* if (is_array($cfg['adapter'])) {*
if (!isset($cfg['adapter']['name'])) {
throw new Exception\InvalidArgumentException('Missing "
adapter.name"');
}
$adapterName = $cfg['adapter']['name'];
$adapterOptions = isset($cfg['adapter']['options']) ? $cfg[
'adapter']['options'] : null;
}
if ($adapterOptions && isset(*$cfg['options'**]*)) {
$adapterOptions = array_merge($adapterOptions, $cfg['options']);
}
$adapter = static::adapterFactory(*(**string)$adapterName*,
$adapterOptions);
btw:
http://framework.zend.com/manual/2.0/en/modules/zend.cache.storage.adapter.html
I have no ideal about how-to use the 'options' option in factory()
use Zend\Cache\StorageFactory;
// Via factory:$cache = StorageFactory::factory(array(
*'adapter' => 'apc',*
'plugins' => array(
'exception_handler' => array('throw_exceptions' => false),
),));
So I just think the option 2 is reasonable. right?
2012/9/25 Matthew Weier O'Phinney <[email protected]>
> You realize that you're passing a very different structure to the
> factory in this second case, right? Structure needs to be
>