Changeset 4978 in subversion
- Timestamp:
- Jul 27, 2011 11:53:48 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.php
r4911 r4978 81 81 private $options = array('auth_method' => 'check'); 82 82 private $host, $user, $pass, $port, $ssl; 83 private $caching = false; 83 84 84 85 /** … … 3815 3816 { 3816 3817 if ($type) { 3817 $rcmail = rcmail::get_instance(); 3818 $this->cache = $rcmail->get_cache('IMAP', $type); 3818 $this->caching = true; 3819 3819 } 3820 3820 else { … … 3822 3822 $this->cache->close(); 3823 3823 $this->cache = null; 3824 } 3825 } 3826 3824 $this->caching = false; 3825 } 3826 } 3827 3828 /** 3829 * Getter for IMAP cache object 3830 */ 3831 private function get_cache_engine() 3832 { 3833 if ($this->caching && !$this->cache) { 3834 $rcmail = rcmail::get_instance(); 3835 $this->cache = $rcmail->get_cache('IMAP', $type); 3836 } 3837 3838 return $this->cache; 3839 } 3827 3840 3828 3841 /** … … 3835 3848 function get_cache($key) 3836 3849 { 3837 if ($ this->cache) {3838 return $ this->cache->get($key);3850 if ($cache = $this->get_cache_engine()) { 3851 return $cache->get($key); 3839 3852 } 3840 3853 } … … 3849 3862 function update_cache($key, $data) 3850 3863 { 3851 if ($ this->cache) {3852 $ this->cache->set($key, $data);3864 if ($cache = $this->get_cache_engine()) { 3865 $cache->set($key, $data); 3853 3866 } 3854 3867 } … … 3864 3877 function clear_cache($key=null, $prefix_mode=false) 3865 3878 { 3866 if ($ this->cache) {3867 $ this->cache->remove($key, $prefix_mode);3879 if ($cache = $this->get_cache_engine()) { 3880 $cache->remove($key, $prefix_mode); 3868 3881 } 3869 3882 }
Note: See TracChangeset
for help on using the changeset viewer.
