Zend Framework

Cache_Backend_TwoLevels: Add protected getters for used backends

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.6
  • Fix Version/s: 1.9.7
  • Component/s: Zend_Cache
  • Labels:
    None

Description

Currently it's impossible to change the behaviour of the TwoLevels backend, as the used
backends are private.

Adding those two getters allows users to subclass the TwoLevels backend and access them.

Index: library/Zend/Cache/Backend/TwoLevels.php
===================================================================
--- library/Zend/Cache/Backend/TwoLevels.php    (Revision 19324)
+++ library/Zend/Cache/Backend/TwoLevels.php    (Arbeitskopie)
@@ -140,6 +140,26 @@
     }

     /**
+     * Returns the used slow backend
+     *
+     * @return Zend_Cache_Backend_ExtendedInterface
+     */
+    protected function _getSlowBackend()
+    {
+        return $this->_slowBackend;
+    }
+
+    /**
+     * Returns the used fast backend
+     *
+     * @return Zend_Cache_Backend_ExtendedInterface
+     */
+    protected function _getFastBackend()
+    {
+        return $this->_fastBackend;
+    }
+
+    /**
      * Test if a cache is available or not (for the given id)
      *
      * @param  string $id cache id

Activity

Hide
Alexander Veremyev added a comment -

Fixed (corresponding properties visibility is changed to 'protected').

Show
Alexander Veremyev added a comment - Fixed (corresponding properties visibility is changed to 'protected').

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: