ZF-6309: Zend_Cache_Backend_File : Change "private" methods to "protected"
Description
Methods in {{Zend_Cache_Backend_File}} are either {{public}} or {{private}}. Using {{protected}} instead of {{private}} would allow ZF users to augment {{Zend_Cache_Backend_File}} without modifying the original code.
Behold the horror we had to do :
if (!class_exists('Zend_Cache_Backend_File_X')) {
$path = 'Zend/Cache/Backend/File.php';
$data = file_get_contents($path);
$data = str_replace('Zend_Cache_Backend_File', 'Zend_Cache_Backend_File_X', $data);
$data = str_replace('private', 'protected', $data);
eval(substr($data, 5)); // Remove PHP tag
}
Please save us from ourselves!
Comments
Posted by axel dahl (whisperstream) on 2009-04-22T10:39:51.000+0000
Absolutely agree, am running into the the same issue on the backend file cache and was going to just copy the backend_file code, rename it, change private to protected and then extend it. Messy!
Posted by Fabien MARTY (fab) on 2009-04-24T12:47:28.000+0000
just fixed into SVN trunk
Posted by Keith Grennan (keithorama) on 2009-06-08T13:58:29.000+0000
Thanks - I wanted this too!