ZF-6291: Zend_Cache::factory() denies creation of Zend_Cache_Backend_TwoLevels backend on Linux

Description

Due to its name sanitation in {{Zend_Cache::_normalizeName()}} {{Zend_Cache::factory()}} does not allow the creation of a {{Zend_Cache_Backend_TwoLevels}} backend on Linux systems (case-sensitive filenames) as {{Zend_Cache::_normalizeName()}} normalizes the string {{"TwoLevels"}} into {{"Twolevels"}} resulting in an include of {{"Zend/Cache/Backend/Twolevels.php"}} which fails on case-sensitive operating systems.

The currect hack is to set {{$customBackendNaming}} to {{true}} and use {{"Zend_Cache_Backend_TwoLevels"}} as the {{$backendName}}.

The fix should be no problem because the {{strtolower()}}-call in line 219 of {{Zend/Cache.php}} is not really necessary - although I suspect that this change will break backwards-compatibility.

Comments

as said in the online manual for ZendPlatform or ZendServer backend, you have to add a separator in the backend name (for example "Two Levels" instead of "TwoLevels")

so I change the issue into a documentation improvement (it's not explicitly said for this this particular backend)

Thanks Fabien.

Even if this is mentioned in the documentation, I'll consider this a "dirty" hack just to circumvent the real problem with the {{strtolower()}}. I actually can not think of a use-case where this {{strtolower()}} will be of any benefit at all besides compensating for sloppy coding. If I didn't break BC, I wouldn't see any problem removing this function-call.

I use "Two_Levels" as backend name for Zend_Cache::factory(). All works fine.

change Assignee because I'm inactive now

Is this only document issue now? if so, I can add an example how to use into the document. :-) But if needs modify code, sadly ,I could not. :-(


$cache = Zend_Cache::factory('Core', 'Two Levels');

Currently I'd say we could live with an explicit remark in the manual.

Generally I think this is rather a code-issue. I'd be nice if you could at least change the manual to include an appropriate remark.

Hi, Stefan, thank You for comment.

I added the example to document at SVN r 17717, so I change the issue type from the Docs: Improvement to bug.

Hi, Stefan.

I tried step by step debugging over Zend_Cache_Backend class.

If we would use words that contains space mark or another mark like as ""Two Levels", I find we could get TwoLevels.php.

So, I close it as solved in next mini release, Docs:problem.