Zend Framework

Zend_Cache_Manager breaks when for empty options

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: Next Major Release
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Cache
  • Labels:
    None

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)

Activity

Hide
Matthew Weier O'Phinney added a comment -

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

Show
Matthew Weier O'Phinney added a comment - Fixed in trunk and 1.10 release branch; simply omit the options if none are needed.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: