Issues

ZF-8932: Zend_Cache_Manager breaks when for empty options

Issue Type: Bug Created: 2010-01-25T10:32:31.000+0000 Last Updated: 2010-01-25T11:41:23.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Renan de Lima (renanbr) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Cache

Related issues: Attachments:

Description

Some cache backend adapters does not require options. When i tried set a template from .ini file a unexpected behavior happens

i've put this in my .ini file

resources.cachemanager.something.frontend.name = Core resources.cachemanager.something.frontend.options.lifetime = 7200 resources.cachemanager.something.frontend.options.automatic_serialization = true resources.cachemanager.something.backend.name = Apc

after i try do this

$cache = $bootstrap->cachemanager->getCache('something');

Expected result

$cache instanceof Zend_Cache_Core; // true

Actual Result

PHP error: Zend_Cache_Backend_Apc::__construct() expects array, null given

i've tried this resources.cachemanager.something.backend.options[] = but not work as well, because this is translated to array(0 => '') so i got Zend_Cache_Exception "Incorrect option name : 0"

It doesn't happens when some option for cache_backend is configured

Possible Solution

when a new template is setted in Zend_Cache_Manager::setCacheTemplate() it may check 'options' index and create this one as a empty array (for both side, frontend and backend)

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2010-01-25T11:41:23.000+0000

Fixed in trunk and 1.10 release branch; simply omit the options if none are needed.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts