Zend Framework

Zend_Cache::factory does not allow for namespaced custom front- or backends

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.6.1
  • Component/s: Zend_Cache
  • Labels:
    None

Description

Zend_Cache::factory() normalizes $frontend and $backend when $customFrontendNaming and/or $customBackendNaming is false by using Zend_Cache::_normalizeName().
Therefore to use custom namespaced front- and/or backends you have to pass true to those parameters respectively (logical because that's the reason for both parameters - to allow for custom back- or frontends).
Later on in the factory() method there is a

Zend_Cache.php line 105
if ($customFrontendNaming) {
    // we use this boolean to avoid an API break
    $frontendClass = 'Zend_Cache_Frontend_' . $frontend;
} else {
    $frontendClass = $frontend;
}

for frontends and a

Zend_Cache.php line 131
if ($customBackendNaming) {
    // we use this boolean to avoid an API break
    $backendClass = 'Zend_Cache_Backend_' . $backend;
} else {
    $backendClass = $backend;
}

for backends.
The if-conditions in line 105 and line 131 must be negated to read:

Zend_Cache.php line 105
if (!$customFrontendNaming) {
    // we use this boolean to avoid an API break
    $frontendClass = 'Zend_Cache_Frontend_' . $frontend;
} else {
    $frontendClass = $frontend;
}

and

Zend_Cache.php line 131
if (!$customBackendNaming) {
    // we use this boolean to avoid an API break
    $backendClass = 'Zend_Cache_Backend_' . $backend;
} else {
    $backendClass = $backend;
}

for custom naming to work.

Activity

Hide
Stefan Gehrig added a comment -

Issue already fixed in trunk revision 10895. Thanks a lot!

Show
Stefan Gehrig added a comment - Issue already fixed in trunk revision 10895. Thanks a lot!
Hide
Fabien MARTY added a comment -

fixed in SVN trunk and 1.6 branch

thanks

Show
Fabien MARTY added a comment - fixed in SVN trunk and 1.6 branch thanks

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: