ZF-6309: Zend_Cache_Backend_File : Change "private" methods to "protected"

Issue Type: Improvement Created: 2009-04-15T13:03:40.000+0000 Last Updated: 2009-06-08T13:58:30.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Sylvain Bernier (sb_demarque) Assignee: Fabien MARTY (fab) Tags: - Zend_Cache

Related issues: Attachments:


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 :

<pre class="literal">
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!


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!

Have you found an issue?

See the Overview section for more details.


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

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