예제 #1
0
파일: TwoLevels.php 프로젝트: netvlies/zf
 private function _getFastFillingPercentage($mode)
 {
     if ($mode == 'saving') {
         // mode saving
         if ($this->_fastBackendFillingPercentage === null) {
             $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
         } else {
             $rand = rand(1, $this->_options['stats_update_factor']);
             if ($rand == 1) {
                 // we force a refresh
                 $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
             }
         }
     } else {
         // mode loading
         // we compute the percentage only if it's not available in cache
         if ($this->_fastBackendFillingPercentage === null) {
             $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
         }
     }
     return $this->_fastBackendFillingPercentage;
 }
예제 #2
0
 /**
  * Clear all the cache values.
  * @return CacheableInterface
  */
 public function clear()
 {
     $this->cache->clean(\Zend_Cache::CLEANING_MODE_ALL);
     return $this;
 }