Esempio n. 1
0
 /**
  * @see OptimizePress_Modules_Email_ProviderInterface::getListFields()
  */
 public function getListFields($listId)
 {
     $cacheKey = md5($this->cachePrefix . '_' . __FUNCTION__ . '_' . $listId);
     if (false === ($data = get_transient($cacheKey))) {
         $data = $this->provider->getListFields($listId);
         set_transient($cacheKey, $data, self::CACHE_EXPIRY_TIME);
     }
     return $data;
 }
Esempio n. 2
0
 /**
  * @see OptimizePress_Modules_Email_ProviderInterface::getListFields()
  */
 public function getListFields($listId)
 {
     /*
      * Cache busting
      */
     if (function_exists('wp_using_ext_object_cache')) {
         $extCache = wp_using_ext_object_cache();
         if (true === $extCache) {
             wp_using_ext_object_cache(false);
         }
     }
     /*
      * Cache key consist of an hour value on purpose to be sure that cache will be invalidated every hour.
      * This is due to some plugins deleting _transient_timeout_* option and leaving _transient_* which makes it valid everytime. It won't expire.
      */
     $cacheKey = md5($this->cachePrefix . '_' . __FUNCTION__ . date('H') . '_' . $listId);
     if (false === ($data = get_transient($cacheKey))) {
         $data = $this->provider->getListFields($listId);
         set_transient($cacheKey, $data, self::CACHE_EXPIRY_TIME);
     }
     /*
      * Cache busting
      */
     if (function_exists('wp_using_ext_object_cache')) {
         wp_using_ext_object_cache($extCache);
     }
     return $data;
 }